|
|
|
@ -23,12 +23,14 @@ namespace NzbDrone.Core.MediaFiles.BookImport.Identification
|
|
|
|
|
{
|
|
|
|
|
var dist = new Distance();
|
|
|
|
|
|
|
|
|
|
var authors = new List<string>();
|
|
|
|
|
// the most common list of authors reported by a file
|
|
|
|
|
var fileAuthors = localTracks.Select(x => x.FileTrackInfo.Authors.Where(a => a.IsNotNullOrWhiteSpace()).ToList())
|
|
|
|
|
.GroupBy(x => x.ConcatToString())
|
|
|
|
|
.OrderByDescending(x => x.Count())
|
|
|
|
|
.First()
|
|
|
|
|
.First();
|
|
|
|
|
|
|
|
|
|
var fileAuthors = localTracks.MostCommon(x => x.FileTrackInfo.Authors);
|
|
|
|
|
if (fileAuthors?.Any() ?? false)
|
|
|
|
|
{
|
|
|
|
|
authors.AddRange(fileAuthors);
|
|
|
|
|
var authors = new List<string>(fileAuthors);
|
|
|
|
|
|
|
|
|
|
foreach (var author in fileAuthors)
|
|
|
|
|
{
|
|
|
|
@ -37,7 +39,6 @@ namespace NzbDrone.Core.MediaFiles.BookImport.Identification
|
|
|
|
|
authors.Add(authors[0].Split(',', 2).Select(x => x.Trim()).Reverse().ConcatToString(" "));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dist.AddString("author", authors, edition.Book.Value.AuthorMetadata.Value.Name);
|
|
|
|
|
Logger.Trace("author: '{0}' vs '{1}'; {2}", authors.ConcatToString("' or '"), edition.Book.Value.AuthorMetadata.Value.Name, dist.NormalizedDistance());
|
|
|
|
|