/// <summary> /// Called when [save playlist command], converts the songs to ids and saves to db /// </summary> private async void OnSavePlaylistCommand() { Log($"Saving playlist"); var songItemsString = PlayListItemViewModels?.Select(x => x.Song.Id + "," + x.PlayedState); if (songItemsString != null) { var jointStr = string.Join(";", songItemsString); if (this.Playlist == null) { this.Playlist = new Playlist(); this.Playlist.Id = 0; this.Playlist.Name = this.TabHeader; } this.Playlist.Count = PlayListItemViewModels.Count; this.Playlist.Items = jointStr; await _horsifyPlaylistService.SavePlaylistAsync(new Playlist[] { this.Playlist }); } }
/// <summary> /// Clears all the playlist items /// </summary> private void OnClearItemsCommand() { Log($"Clearing playlist items"); PlayListItemViewModels?.Clear(); }