Ejemplo n.º 1
0
 public void DoubleclickPlaylistRow(TrackInfo track)
 {
     if (PlaylistTracks.Any(t => t.Id == track.Id))
     {
         return;
     }
     PlaylistTracks.Add(track);
 }
Ejemplo n.º 2
0
 protected void PlaylistRowClick(Int64 id)
 {
     if (Data.CurrentTrack != null && Data.CurrentTrack.Id == id || !PlaylistTracks.Any(t => t.Id == id))
     {
         return;
     }
     Data.CurrentTrack = PlaylistTracks.First(t => t.Id == id);
     this.StateHasChanged();
 }
Ejemplo n.º 3
0
        protected void PlaylistRowRemoveClick(Int64 id)
        {
            if (!PlaylistTracks.Any(t => t.Id == id))
            {
                return;
            }
            if (Data.CurrentTrack != null && Data.CurrentTrack.Id == id)
            {
                SetCurrentTrackNext();
            }

            RemovePlaylistTrack(id);
        }
Ejemplo n.º 4
0
        protected void PlaylistRowDoubleClick(Int64 id)
        {
            if (Data.IsPlaying)
            {
                return;
            }
            Data.IsPlaying = true;
            if (Data.CurrentTrack.Id == id || !PlaylistTracks.Any(t => t.Id == id))
            {
                this.StateHasChanged();
                return;
            }

            Data.CurrentTrack = PlaylistTracks.First(t => t.Id == id);
            this.StateHasChanged();
        }
Ejemplo n.º 5
0
        private async Task LoadPlaylist()
        {
            Wrap.Cookie playlistCookie = new Wrap.Cookie("playlist", JsRuntime);
            string      sidList        = await playlistCookie.Get();

            if (sidList != null)
            {
                (await Data.GetTracks(sidList)).ForEach(t =>
                {
                    if (!PlaylistTracks.Any(p => p.Id == t.Id))
                    {
                        PlaylistTracks.Add(t);
                    }
                });
            }
            if (PlaylistTracks.Count > 0)
            {
                this.StateHasChanged();
            }
        }