New: Improve match by adding small penalty for missing isbn/asin

pull/1332/head
ta264 3 years ago
parent a9e181425b
commit 847a9eae93

@ -14,7 +14,9 @@ namespace NzbDrone.Core.MediaFiles.BookImport.Identification
{ "author", 3.0 },
{ "book", 3.0 },
{ "isbn", 10.0 },
{ "isbn_missing", 0.1 },
{ "asin", 10.0 },
{ "asin_missing", 0.1 },
{ "media_count", 1.0 },
{ "media_format", 1.0 },
{ "year", 1.0 },

@ -81,6 +81,11 @@ namespace NzbDrone.Core.MediaFiles.BookImport.Identification
dist.AddBool("isbn", isbn != edition.Isbn13);
Logger.Trace("isbn: '{0}' vs '{1}'; {2}", isbn, edition.Isbn13, dist.NormalizedDistance());
}
else if (isbn.IsNullOrWhiteSpace() != edition.Isbn13.IsNullOrWhiteSpace())
{
dist.AddBool("isbn_missing", true);
Logger.Trace("isbn: '{0}' vs '{1}'; {2}", isbn, edition.Isbn13, dist.NormalizedDistance());
}
var asin = localTracks.MostCommon(x => x.FileTrackInfo.Asin);
if (asin.IsNotNullOrWhiteSpace() && edition.Asin.IsNotNullOrWhiteSpace())
@ -88,6 +93,11 @@ namespace NzbDrone.Core.MediaFiles.BookImport.Identification
dist.AddBool("asin", asin != edition.Asin);
Logger.Trace("asin: '{0}' vs '{1}'; {2}", asin, edition.Asin, dist.NormalizedDistance());
}
else if (asin.IsNullOrWhiteSpace() != edition.Asin.IsNullOrWhiteSpace())
{
dist.AddBool("asin_missing", true);
Logger.Trace("asin: '{0}' vs '{1}'; {2}", asin, edition.Asin, dist.NormalizedDistance());
}
// Year
var localYear = localTracks.MostCommon(x => x.FileTrackInfo.Year);

Loading…
Cancel
Save