public PlaylistSongViewModel(Song song, bool isPlayed, bool isPlaying) { this.Song = song; this._isPlayed = isPlayed; this._isPlaying = isPlaying; }
private async Task AddOrUpdateSong(Song song, IEnumerable<string> genres) { songsToAdd.Add(song); foreach (var genre in genres) songGenresToAdd.Add(new Tuple<Song, string>(song, genre)); if (songsToAdd.Count > 25) await AddAllRemainingSongs(); }
internal async void GoToPlayMode(Song song, SongSource songSource) { var library = this.library ?? await libraryLoadingTask; if (await library.PlaylistManager.PlayFromSource(songSource, song.Id)) this.audioControls.Play(); }
public bool Contains(Song song) { return song.Album.Equals(this.Name, StringComparison.CurrentCultureIgnoreCase) && song.AlbumArtist.Equals(this.Artist, StringComparison.CurrentCultureIgnoreCase); }
public async Task<IEnumerable<Song>> PredictNextSongs(IEnumerable<Song> alreadyPredicted, Song current, int count) { return (await databaseConnection.QueryAsync<Song>("select s.* from Song s, CurrentPlaylistSong c where s.Id = c.SongId order by c.rank limit ? offset ?", count, alreadyPredicted.Count() + 1 + this.CurrentIndex)); }