Add artist and year to album spec string when available

This commit is contained in:
Daniel Underwood
2017-07-07 23:27:18 -04:00
parent e617563b63
commit 8c4d99eeff
2 changed files with 15 additions and 1 deletions
@@ -6,7 +6,16 @@ namespace NzbDrone.Core.IndexerSearch.Definitions
{
public override string ToString()
{
return $"[{Album.Title}]";
var baseRepresentation = $"[{Artist.Name} - {Album.Title}]";
if (Album.ReleaseDate.HasValue)
{
var beforeLast = baseRepresentation.Length - 1;
return baseRepresentation.Insert(beforeLast, $" ({Album.ReleaseDate.Value.Year})");
}
else
{
return baseRepresentation;
}
}
}
}