Fixed: Allow add and search of PTP

pull/6/head
Qstick 4 years ago
parent 628ec9c53f
commit e2a46820da

@ -14,13 +14,7 @@ namespace NzbDrone.Core.Indexers.PassThePopcorn
public override bool SupportsRss => true; public override bool SupportsRss => true;
public override bool SupportsSearch => true; public override bool SupportsSearch => true;
public override IndexerCapabilities Capabilities => new IndexerCapabilities public override IndexerCapabilities Capabilities => SetCapabilities();
{
MovieSearchParams = new List<MovieSearchParam>
{
MovieSearchParam.Q, MovieSearchParam.ImdbId
}
};
public override int PageSize => 50; public override int PageSize => 50;
@ -43,6 +37,33 @@ namespace NzbDrone.Core.Indexers.PassThePopcorn
}; };
} }
private IndexerCapabilities SetCapabilities()
{
var caps = new IndexerCapabilities
{
MovieSearchParams = new List<MovieSearchParam>
{
MovieSearchParam.Q, MovieSearchParam.ImdbId
}
};
caps.Categories.AddCategoryMapping(1.ToString(), NewznabStandardCategory.Movies, "Feature Film");
caps.Categories.AddCategoryMapping(1.ToString(), NewznabStandardCategory.MoviesForeign);
caps.Categories.AddCategoryMapping(1.ToString(), NewznabStandardCategory.MoviesOther);
caps.Categories.AddCategoryMapping(1.ToString(), NewznabStandardCategory.MoviesSD);
caps.Categories.AddCategoryMapping(1.ToString(), NewznabStandardCategory.MoviesHD);
caps.Categories.AddCategoryMapping(1.ToString(), NewznabStandardCategory.Movies3D);
caps.Categories.AddCategoryMapping(1.ToString(), NewznabStandardCategory.MoviesBluRay);
caps.Categories.AddCategoryMapping(1.ToString(), NewznabStandardCategory.MoviesDVD);
caps.Categories.AddCategoryMapping(1.ToString(), NewznabStandardCategory.MoviesWEBDL);
caps.Categories.AddCategoryMapping(2.ToString(), NewznabStandardCategory.Movies, "Short Film");
caps.Categories.AddCategoryMapping(3.ToString(), NewznabStandardCategory.TV, "Miniseries");
caps.Categories.AddCategoryMapping(4.ToString(), NewznabStandardCategory.TV, "Stand-up Comedy");
caps.Categories.AddCategoryMapping(5.ToString(), NewznabStandardCategory.TV, "Live Performance");
return caps;
}
public override IParseIndexerResponse GetParser() public override IParseIndexerResponse GetParser()
{ {
return new PassThePopcornParser(Settings, _logger); return new PassThePopcornParser(Settings, _logger);

@ -102,7 +102,8 @@ namespace NzbDrone.Core.Indexers.PassThePopcorn
Scene = torrent.Scene, Scene = torrent.Scene,
Approved = torrent.Checked, Approved = torrent.Checked,
ImdbId = result.ImdbId.IsNotNullOrWhiteSpace() ? int.Parse(result.ImdbId) : 0, ImdbId = result.ImdbId.IsNotNullOrWhiteSpace() ? int.Parse(result.ImdbId) : 0,
IndexerFlags = flags IndexerFlags = flags,
Category = new List<IndexerCategory> { NewznabStandardCategory.Movies }
}); });
} }
catch (Exception e) catch (Exception e)

@ -75,7 +75,11 @@ namespace NzbDrone.Core.Indexers.PassThePopcorn
public IndexerPageableRequestChain GetSearchRequests(BasicSearchCriteria searchCriteria) public IndexerPageableRequestChain GetSearchRequests(BasicSearchCriteria searchCriteria)
{ {
return new IndexerPageableRequestChain(); var pageableRequests = new IndexerPageableRequestChain();
pageableRequests.Add(GetRequest(string.Format("{0}", searchCriteria.SearchTerm)));
return pageableRequests;
} }
} }
} }

Loading…
Cancel
Save