public bool AddSongToPlaylist(Song song, Playlist playlist) { //var result = false; //if (ContainsPlaylist(playlist)) //{ // _playlists.Find(pl => pl.Id == playlist.Id).Add(song); // if (playlist.Id != -1) PlaylistsChanged = true; // result = true; //} //return result; throw new NotImplementedException(); }
//public Playlist PlayedSongs { get; private set; } public PlaylistService(IRequestService requestService) { _publisher = Publisher.Instance; _publisher.SubscribeToMessages(this, "SignIn", "SighOut"); _requestService = requestService; PlaylistsChanged = false; //PlayedSongs = new Playlist(-1, PlayedSongsName, new List<Song>()); CurrentPlaylist = new Playlist(-1, CurrentPlaylistName, new List<Song>()); //_playlists = new List<Playlist> { PlayedSongs }; _playlists = new List<Playlist>(); Playlists = new ListCollectionView(_playlists); //Playlists.CurrentChanged += PlaylistSelected; }
public bool RenamePlaylist(Playlist playlist, string newName) { //var response = _requestService.GetResponse(APIPlaylist, // string.Format("cmd=rename&name={0}&pid={1}", newName, playlist.Id)); //var contract = DeserializeJson<object>(response); //return contract.Success; throw new NotImplementedException(); }
public bool RemoveSongFromPlaylist(Song song, Playlist playlist) { var removeResult = playlist.Remove(song); if (playlist.Id != -1) PlaylistsChanged = removeResult; return removeResult; }