mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-26 23:06:43 -04:00
Remove FetchRecent, Pass Cats back on Newznab Search
This commit is contained in:
@@ -186,13 +186,14 @@ namespace NzbDrone.Core.Indexers.Cardigann
|
||||
return variables;
|
||||
}
|
||||
|
||||
/*
|
||||
protected ICollection<int> MapTrackerCatToNewznab(string input)
|
||||
{
|
||||
if (input == null)
|
||||
{
|
||||
return new List<int>();
|
||||
}
|
||||
|
||||
var cats = categoryMapping.Where(m => m.TrackerCategory != null && m.TrackerCategory.ToLowerInvariant() == input.ToLowerInvariant()).Select(c => c.NewzNabCategory).ToList();
|
||||
var cats = _definition.Caps.Categorymappings.Where(m => m.id != null && m.id.ToLowerInvariant() == input.ToLowerInvariant()).Select(c => TorznabCatType.GetCatByName(c.cat).Id).ToList();
|
||||
|
||||
// 1:1 category mapping
|
||||
try
|
||||
@@ -206,12 +207,17 @@ namespace NzbDrone.Core.Indexers.Cardigann
|
||||
}
|
||||
|
||||
return cats;
|
||||
}*/
|
||||
}
|
||||
|
||||
public List<string> MapTorznabCapsToTrackers(int[] searchCategories, bool mapChildrenCatsToParent = false)
|
||||
{
|
||||
var queryCats = new List<string>();
|
||||
|
||||
if (searchCategories == null)
|
||||
{
|
||||
return queryCats;
|
||||
}
|
||||
|
||||
foreach (var searchCat in searchCategories)
|
||||
{
|
||||
var match = TorznabCatType.AllCats.FirstOrDefault(c => c.Id == searchCat);
|
||||
|
||||
@@ -199,8 +199,7 @@ namespace NzbDrone.Core.Indexers.Cardigann
|
||||
value = release.Description;
|
||||
break;
|
||||
case "category":
|
||||
// var cats = MapTrackerCatToNewznab(value);
|
||||
var cats = new List<int> { 2000 };
|
||||
var cats = MapTrackerCatToNewznab(value);
|
||||
if (cats.Any())
|
||||
{
|
||||
if (release.Category == null || fieldModifiers.Contains("noappend"))
|
||||
@@ -482,7 +481,8 @@ namespace NzbDrone.Core.Indexers.Cardigann
|
||||
MagnetUrl = x.MagnetUri?.ToString(),
|
||||
InfoHash = x.InfoHash,
|
||||
Seeders = (int?)x.Seeders,
|
||||
Peers = (int?)x.Peers
|
||||
Peers = (int?)x.Peers,
|
||||
Category = x.Category
|
||||
}));
|
||||
|
||||
_logger.Debug($"Got {result.Count} releases");
|
||||
|
||||
@@ -30,6 +30,13 @@ namespace NzbDrone.Core.Indexers.Cardigann
|
||||
|
||||
var variables = GetBaseTemplateVariables();
|
||||
|
||||
variables[".Query.Type"] = null;
|
||||
variables[".Query.Q"] = null;
|
||||
variables[".Query.Categories"] = null;
|
||||
variables[".Query.IMDBID"] = null;
|
||||
variables[".Query.IMDBIDShort"] = null;
|
||||
variables[".Query.TMDBID"] = null;
|
||||
|
||||
pageableRequests.Add(GetRequest(variables));
|
||||
|
||||
return pageableRequests;
|
||||
|
||||
@@ -13,13 +13,6 @@ namespace NzbDrone.Core.Indexers.FileList
|
||||
public Func<IDictionary<string, string>> GetCookies { get; set; }
|
||||
public Action<IDictionary<string, string>, DateTime?> CookiesUpdater { get; set; }
|
||||
|
||||
public virtual IndexerPageableRequestChain GetRecentRequests()
|
||||
{
|
||||
var pageableRequests = new IndexerPageableRequestChain();
|
||||
pageableRequests.Add(GetRequest("latest-torrents", ""));
|
||||
return pageableRequests;
|
||||
}
|
||||
|
||||
public virtual IndexerPageableRequestChain GetSearchRequests(MovieSearchCriteria searchCriteria)
|
||||
{
|
||||
var pageableRequests = new IndexerPageableRequestChain();
|
||||
@@ -28,11 +21,15 @@ namespace NzbDrone.Core.Indexers.FileList
|
||||
{
|
||||
pageableRequests.Add(GetRequest("search-torrents", string.Format("&type=imdb&query={0}", searchCriteria.ImdbId)));
|
||||
}
|
||||
else
|
||||
else if (searchCriteria.SearchTerm.IsNotNullOrWhiteSpace())
|
||||
{
|
||||
var titleYearSearchQuery = string.Format("{0}", searchCriteria.SearchTerm);
|
||||
pageableRequests.Add(GetRequest("search-torrents", string.Format("&type=name&query={0}", titleYearSearchQuery.Trim())));
|
||||
}
|
||||
else
|
||||
{
|
||||
pageableRequests.Add(GetRequest("latest-torrents", ""));
|
||||
}
|
||||
|
||||
return pageableRequests;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user