From d1e3390baea4757e3c32f8a008235185ec049832 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Wed, 30 Apr 2025 21:39:45 +0300 Subject: [PATCH] Fixed: (PTP) Category mapping for search results --- .../Indexers/Definitions/PassThePopcorn/PassThePopcorn.cs | 2 +- .../Definitions/PassThePopcorn/PassThePopcornApi.cs | 1 + .../Definitions/PassThePopcorn/PassThePopcornParser.cs | 6 ++++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/NzbDrone.Core/Indexers/Definitions/PassThePopcorn/PassThePopcorn.cs b/src/NzbDrone.Core/Indexers/Definitions/PassThePopcorn/PassThePopcorn.cs index 1bb7b54be..b1ef7273d 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/PassThePopcorn/PassThePopcorn.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/PassThePopcorn/PassThePopcorn.cs @@ -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() diff --git a/src/NzbDrone.Core/Indexers/Definitions/PassThePopcorn/PassThePopcornApi.cs b/src/NzbDrone.Core/Indexers/Definitions/PassThePopcorn/PassThePopcornApi.cs index 5b24f0c24..d6b2bb117 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/PassThePopcorn/PassThePopcornApi.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/PassThePopcorn/PassThePopcornApi.cs @@ -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; } diff --git a/src/NzbDrone.Core/Indexers/Definitions/PassThePopcorn/PassThePopcornParser.cs b/src/NzbDrone.Core/Indexers/Definitions/PassThePopcorn/PassThePopcornParser.cs index 30b83ecef..f12e2de86 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/PassThePopcorn/PassThePopcornParser.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/PassThePopcorn/PassThePopcornParser.cs @@ -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 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 { NewznabStandardCategory.Movies }, + Categories = _categories.MapTrackerCatToNewznab(result.CategoryId), Size = long.Parse(torrent.Size), Grabs = int.Parse(torrent.Snatched), Seeders = int.Parse(torrent.Seeders),