Fixed: (PTP) Category mapping for search results

This commit is contained in:
Bogdan
2025-04-30 21:39:45 +03:00
parent 1cd60c7a40
commit d1e3390bae
3 changed files with 6 additions and 3 deletions

View File

@@ -36,7 +36,7 @@ namespace NzbDrone.Core.Indexers.Definitions.PassThePopcorn
public override IParseIndexerResponse GetParser()
{
return new PassThePopcornParser(Settings);
return new PassThePopcornParser(Settings, Capabilities.Categories);
}
private IndexerCapabilities SetCapabilities()

View File

@@ -14,6 +14,7 @@ namespace NzbDrone.Core.Indexers.Definitions.PassThePopcorn
public class PassThePopcornMovie
{
public string GroupId { get; set; }
public string CategoryId { get; set; }
public string Title { get; set; }
public string Year { get; set; }
public string Cover { get; set; }

View File

@@ -13,10 +13,12 @@ namespace NzbDrone.Core.Indexers.Definitions.PassThePopcorn
public class PassThePopcornParser : IParseIndexerResponse
{
private readonly PassThePopcornSettings _settings;
private readonly IndexerCapabilitiesCategories _categories;
public PassThePopcornParser(PassThePopcornSettings settings)
public PassThePopcornParser(PassThePopcornSettings settings, IndexerCapabilitiesCategories categories)
{
_settings = settings;
_categories = categories;
}
public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
@@ -94,7 +96,7 @@ namespace NzbDrone.Core.Indexers.Definitions.PassThePopcorn
Year = int.Parse(result.Year),
InfoUrl = GetInfoUrl(result.GroupId, id),
DownloadUrl = GetDownloadUrl(id, jsonResponse.AuthKey, jsonResponse.PassKey),
Categories = new List<IndexerCategory> { NewznabStandardCategory.Movies },
Categories = _categories.MapTrackerCatToNewznab(result.CategoryId),
Size = long.Parse(torrent.Size),
Grabs = int.Parse(torrent.Snatched),
Seeders = int.Parse(torrent.Seeders),