public static int GetMostCommonBitRateFromTracks(IAlbum album) { var bitRate = album.Tracks().Select(f => f.BitRate); var query = bitRate.GroupBy(item => item). OrderByDescending(g => g.Count()). Select(g => g.Key).First(); return(Convert.ToInt32(query)); }
public static BsonArray GetAlbumTracksAsBson(IAlbum album) { var tracks = new BsonArray(); foreach (IMp3 mp3 in album.Tracks()) { var dbTrack = GetMp3AsBson(mp3); tracks.Add(dbTrack); } return(tracks); }
private void WriteAlbum(IArtist artist, IAlbum album) { Log.WriteInfoToLog("Writing: {0} - {1}", artist.Name, album.Title); var writingFolder = _formatter.GetFolderToWriteTo(_outFolder.FullName, artist, album); foreach (IMp3 track in album.Tracks()) { WriteTrack(writingFolder, track, album); } CopyAdditionalFiles(writingFolder, album); if (_copyType == CopyType.Move) { DeleteSourceFiles(album); } }
public UpgradeResult UpgradeAlbum(IAlbum rippedAlbum, IAlbum dbAlbum) { var rippedTracks = rippedAlbum.Tracks().ToList(); var dbTracks = dbAlbum.Tracks().ToList(); var errors = 0; if (rippedTracks.Count == dbTracks.Count) { } else { errors += 1; } return(UpgradeResult.NoErrors); }
public static string GetMostCommonArtistNameFromTracks(IAlbum album) { var artistQuery = album.Tracks().Select(f => f.Artist); return(GetCommonString(artistQuery)); }
public static string GetMostCommonYearFromTracks(IAlbum album) { var yearsQuery = album.Tracks().Select(f => f.Year); return(GetCommonString(yearsQuery)); }
public static string GetMostCommonAlbumTitleFromTracks(IAlbum album) { var albumQuery = album.Tracks().Select(f => f.Album); return(GetCommonString(albumQuery)); }