예제 #1
0
 // GET: /Spotify/AddTrackToPlayList
 public ContentResult AddTrackToPlaylist(
     string id,
     string playlistId,
     string playlistName)
 {
     if (playlistId == null && Spotify.CurrentPlaylists.ContainsKey(playlistName))
     {
         playlistId = Spotify.CurrentPlaylists[playlistName].Id;
     }
     if (playlistId == null)
     {
         playlistId = Spotify.AddPlayList(playlistName);
     }
     Spotify.AddTrackToPlayList(playlistId, id);
     return(this.Content(""));
 }
예제 #2
0
 // GET: /Spotify/AddAlbumToPlayList
 public ContentResult AddAlbumToPlayList(
     string id,
     string playlistId,
     string playlistName)
 {
     if (playlistId == null && Spotify.CurrentPlaylists.ContainsKey(playlistName))
     {
         playlistId = Spotify.CurrentPlaylists[playlistName].Id;
     }
     if (playlistId == null && !string.IsNullOrEmpty(playlistName))
     {
         playlistId = Spotify.AddPlayList(playlistName);
     }
     if (playlistId != null)
     {
         Spotify.AddAlbumToPlayList(playlistId, id);
     }
     return(this.Content(""));
 }