New: Improved Logging of Search for ID based searches

This commit is contained in:
bakerboy448
2021-08-27 19:18:34 -05:00
parent e49d03ab7b
commit c21e323992
4 changed files with 94 additions and 3 deletions
@@ -1,3 +1,4 @@
using System.Text;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Parser;
@@ -23,5 +24,42 @@ namespace NzbDrone.Core.IndexerSearch.Definitions
}
public string FullImdbId => ParseUtil.GetFullImdbId(ImdbId);
public override string SearchQuery
{
get
{
var searchQueryTerm = $"Term: []";
if (SearchTerm.IsNotNullOrWhiteSpace())
{
searchQueryTerm = $"Term: [{SearchTerm}]";
}
if (!ImdbId.IsNotNullOrWhiteSpace() && !TmdbId.HasValue && !TraktId.HasValue)
{
return searchQueryTerm;
}
var builder = new StringBuilder(searchQueryTerm);
builder = builder.Append(" | ID(s):");
if (ImdbId.IsNotNullOrWhiteSpace())
{
builder = builder.Append($" IMDbId:[{ImdbId}]");
}
if (TmdbId.HasValue)
{
builder = builder.Append($" TMDbId:[{TmdbId}]");
}
if (TraktId.HasValue)
{
builder = builder.Append($" TraktId:[{TraktId}]");
}
return builder.ToString().Trim();
}
}
}
}