コード例 #1
0
        public void AddPlaylistToSpotify(PlaylistObject playlist)
        {
            var trackUris = new List <string>();

            foreach (var guid in playlist.Albums)
            {
                IAlbum album = (IAlbum)GetMusicObject(guid);
                if (album is SpotifyAlbum)
                {
                    List <SpotifyTrack> trackList = GetTracks(album).Cast <SpotifyTrack>().ToList();
                    foreach (var track in trackList)
                    {
                        trackUris.Add(track.SpotifyID);
                    }
                }
            }

            FullPlaylist newPlaylist = SpotifyApi.CreatePlaylist(playlist.Name, _settings.Creds.SpotifyUser, _spotifyAuth);

            SpotifyApi.AddPlaylistTracks(trackUris, newPlaylist, _spotifyAuth);
        }
コード例 #2
0
 public void AddPlaylist(PlaylistObject playlist)
 {
     _playlist.Add(playlist);
 }
コード例 #3
0
 public void RemovePlaylist(PlaylistObject playlist)
 {
     _playlist.Remove(playlist);
 }
コード例 #4
0
 public void Add(PlaylistObject playlist)
 {
     _playlists.Add(playlist);
 }