History Improvements Round 1

This commit is contained in:
Qstick
2021-03-07 23:07:12 -05:00
parent 0fa526a1af
commit 9fab7d8328
54 changed files with 395 additions and 79 deletions
@@ -1,8 +1,23 @@
using NzbDrone.Common.Extensions;
namespace NzbDrone.Core.IndexerSearch.Definitions
{
public class BookSearchCriteria : SearchCriteriaBase
{
public string Author { get; set; }
public string Title { get; set; }
public override bool RssSearch
{
get
{
if (SearchTerm.IsNullOrWhiteSpace() && Author.IsNullOrWhiteSpace() && Title.IsNullOrWhiteSpace())
{
return true;
}
return false;
}
}
}
}
@@ -1,3 +1,5 @@
using NzbDrone.Common.Extensions;
namespace NzbDrone.Core.IndexerSearch.Definitions
{
public class MovieSearchCriteria : SearchCriteriaBase
@@ -5,5 +7,18 @@ namespace NzbDrone.Core.IndexerSearch.Definitions
public string ImdbId { get; set; }
public int? TmdbId { get; set; }
public int? TraktId { get; set; }
public override bool RssSearch
{
get
{
if (SearchTerm.IsNullOrWhiteSpace() && ImdbId.IsNullOrWhiteSpace() && !TmdbId.HasValue && !TraktId.HasValue)
{
return true;
}
return false;
}
}
}
}
@@ -1,3 +1,6 @@
using System.Collections.Generic;
using NzbDrone.Common.Extensions;
namespace NzbDrone.Core.IndexerSearch.Definitions
{
public class MusicSearchCriteria : SearchCriteriaBase
@@ -5,5 +8,18 @@ namespace NzbDrone.Core.IndexerSearch.Definitions
public string Album { get; set; }
public string Artist { get; set; }
public string Label { get; set; }
public override bool RssSearch
{
get
{
if (SearchTerm.IsNullOrWhiteSpace() && Album.IsNullOrWhiteSpace() && Artist.IsNullOrWhiteSpace() && Label.IsNullOrWhiteSpace())
{
return true;
}
return false;
}
}
}
}
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using NzbDrone.Common.Extensions;
namespace NzbDrone.Core.IndexerSearch.Definitions
{
@@ -24,6 +25,19 @@ namespace NzbDrone.Core.IndexerSearch.Definitions
return $"{{Term: {SearchTerm}, Offset: {Offset ?? 0}, Limit: {Limit ?? 0}, Categories: [{string.Join(", ", Categories)}]}}";
}
public virtual bool RssSearch
{
get
{
if (SearchTerm.IsNullOrWhiteSpace())
{
return true;
}
return false;
}
}
public string SanitizedSearchTerm
{
get
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Parser;
@@ -19,6 +20,19 @@ namespace NzbDrone.Core.IndexerSearch.Definitions
public string SanitizedTvSearchString => (SanitizedSearchTerm + " " + EpisodeSearchString).Trim();
public string EpisodeSearchString => GetEpisodeSearchString();
public override bool RssSearch
{
get
{
if (SearchTerm.IsNullOrWhiteSpace() && ImdbId.IsNullOrWhiteSpace() && !TvdbId.HasValue && !RId.HasValue && !TraktId.HasValue && !TvMazeId.HasValue)
{
return true;
}
return false;
}
}
private string GetEpisodeSearchString()
{
if (Season == 0)