private async Task GetPlaylistItems()
        {
            var playlist = await _playlistHelper.GetPlaylist();

            if (playlist == null || playlist.ModifiedDate == _lastReadDate)
            {
                return;
            }

            _lastReadDate = playlist.ModifiedDate;

            Playlist = new ObservableCollection <PlaylistItem>(playlist.PlaylistItems);

            IsShuffled = playlist.IsShuffled;
            IsOnRepeat = playlist.IsOnRepeat;

            var nowPlaying = playlist.PlaylistItems.FirstOrDefault(x => x.IsPlaying);

            NowPlayingItem = nowPlaying;

            if (DispatcherHelper.UIDispatcher != null)
            {
                DispatcherHelper.CheckBeginInvokeOnUI(() => RaisePropertyChanged(() => PlayedPercentage));
            }
        }
Exemplo n.º 2
0
        private void GetPlaylistItems()
        {
            var playlist = _playlistHelper.GetPlaylist();

            if (playlist == null || playlist.ModifiedDate == _lastReadDate)
            {
                return;
            }

            _lastReadDate = playlist.ModifiedDate;

            Playlist = new ObservableCollection <PlaylistItem>(playlist.PlaylistItems);

            IsShuffled = playlist.IsShuffled;
            IsOnRepeat = playlist.IsOnRepeat;

            var nowPlaying = playlist.PlaylistItems.FirstOrDefault(x => x.IsPlaying);

            NowPlayingItem = nowPlaying;
        }