public void PlayPlaylistTrack(Guid playlistId, int position) { Playlist playlist = Playlist.GetById(playlistId); this.playlist = playlist; if (position != -1) { spotify.PlayerLoad(playlist.playlist.Tracks[position]); } playQueue.Feed = playlist.playlist.Tracks.Cast <ITrack>(); if (position == -1) { spotify.PlayerLoad(playQueue.Dequeue()); } if (position != -1) { playQueue.Index = position; } if (position != -1) { playQueue.Current = playlist.playlist.Tracks[position]; } spotify.PlayerPlay(); spotify_SongStarted(spotify, new EventArgs()); }
public IEnumerable <Track> GetPlaylistTracks(Guid id) { Playlist playlist = Playlist.GetById(id); return(playlist.playlist.Tracks.Select(t => new Track(t)).ToArray()); }