Use Album Disambiguation/Type when searching and picking releases (#490)

* Use Album Disambiguation/Type when searching and picking releases

* Add Disambiguations to AlbumQuery

* use string interpolation for AlbumQuery

* cosmetic change in log text
pull/6/head
gismo2004 6 years ago committed by Qstick
parent b8511f039a
commit 29c52e47bb

@ -1,18 +1,18 @@
using System; using NzbDrone.Common.Extensions;
namespace NzbDrone.Core.IndexerSearch.Definitions namespace NzbDrone.Core.IndexerSearch.Definitions
{ {
public class AlbumSearchCriteria : SearchCriteriaBase public class AlbumSearchCriteria : SearchCriteriaBase
{ {
public string AlbumTitle { get; set; } public string AlbumTitle { get; set; }
public int AlbumYear { get; set; } public int AlbumYear { get; set; }
public string Disambiguation { get; set; }
public string AlbumQuery => GetQueryTitle(AlbumTitle); public string AlbumQuery => GetQueryTitle($"{AlbumTitle}{(Disambiguation.IsNullOrWhiteSpace() ? string.Empty : $"+{Disambiguation}")}");
public override string ToString() public override string ToString()
{ {
return string.Format("[{0} - {1} ({2})]", Artist.Name, AlbumTitle, AlbumYear); return $"[{Artist.Name} - {AlbumTitle}{(Disambiguation.IsNullOrWhiteSpace() ? string.Empty : $" ({Disambiguation})")} ({AlbumYear})]";
} }
} }
} }

@ -9,6 +9,7 @@ using NzbDrone.Core.IndexerSearch.Definitions;
using NzbDrone.Core.Indexers; using NzbDrone.Core.Indexers;
using NzbDrone.Core.Parser.Model; using NzbDrone.Core.Parser.Model;
using System.Linq; using System.Linq;
using NzbDrone.Common.Extensions;
using NzbDrone.Common.TPL; using NzbDrone.Common.TPL;
using NzbDrone.Core.Music; using NzbDrone.Core.Music;
@ -76,7 +77,12 @@ namespace NzbDrone.Core.IndexerSearch
{ {
searchSpec.AlbumYear = album.ReleaseDate.Value.Year; searchSpec.AlbumYear = album.ReleaseDate.Value.Year;
} }
if (album.Disambiguation.IsNotNullOrWhiteSpace())
{
searchSpec.Disambiguation = album.Disambiguation;
}
return Dispatch(indexer => indexer.Fetch(searchSpec), searchSpec); return Dispatch(indexer => indexer.Fetch(searchSpec), searchSpec);
} }

Loading…
Cancel
Save