Exemple #1
0
        async void Device_CurrentIdChanged(object sender, CurrentIdEventArgs e)
        {
            if (e.Id != Guid.Empty)
            {
                if (_currentItem != null && _currentItem.Id == e.Id)
                {
                    return;
                }

                var item = _libraryManager.GetItemById(e.Id);

                if (item != null)
                {
                    _logger.Debug("{0} - CurrentId {1}", _session.DeviceName, item.Id);
                    _currentItem     = item;
                    _playbackStarted = false;

                    await ReportProgress().ConfigureAwait(false);
                }
            }
        }
        async void Device_CurrentIdChanged(object sender, CurrentIdEventArgs e)
        {
            if (e.Id != Guid.Empty)
            {
                if (_currentItem != null && _currentItem.Id == e.Id)
                {
                    return;
                }

                var item = _libraryManager.GetItemById(e.Id);

                if (item != null)
                {
                    _logger.Debug("{0} - CurrentId {1}", _session.DeviceName, item.Id);
                    _currentItem = item;
                    _playbackStarted = false;

                    await ReportProgress().ConfigureAwait(false);
                }
            }
        }
        async void Device_CurrentIdChanged(object sender, CurrentIdEventArgs e)
        {
            if (!string.IsNullOrWhiteSpace(e.Id))
            {
                Guid guid;

                if (Guid.TryParse(e.Id, out guid))
                {
                    if (_currentItem != null && _currentItem.Id == guid)
                    {
                        return;
                    }

                    var item = _libraryManager.GetItemById(guid);

                    if (item != null)
                    {
                        _logger.Debug("{0} - CurrentId {1}", _session.DeviceName, item.Id);
                        _currentItem = item;
                        _playbackStarted = false;

                        await ReportProgress().ConfigureAwait(false);
                    }
                }
            }
        }