Add movie categories to HoundDawgs (#902)

This commit is contained in:
Frederik Nielsen 2016-12-30 13:50:04 +01:00 committed by kaso17
parent 8e8f143b02
commit 0838a0b258
1 changed files with 28 additions and 6 deletions

View File

@ -45,7 +45,7 @@ namespace Jackett.Indexers
{ {
Encoding = Encoding.GetEncoding("UTF-8"); Encoding = Encoding.GetEncoding("UTF-8");
Language = "da-dk"; Language = "da-dk";
// TV Mapping
AddCategoryMapping(92, TorznabCatType.TV); AddCategoryMapping(92, TorznabCatType.TV);
AddCategoryMapping(92, TorznabCatType.TVHD); AddCategoryMapping(92, TorznabCatType.TVHD);
AddCategoryMapping(92, TorznabCatType.TVWEBDL); AddCategoryMapping(92, TorznabCatType.TVWEBDL);
@ -60,6 +60,25 @@ namespace Jackett.Indexers
AddCategoryMapping(74, TorznabCatType.TVSD); AddCategoryMapping(74, TorznabCatType.TVSD);
AddCategoryMapping(74, TorznabCatType.TV); AddCategoryMapping(74, TorznabCatType.TV);
// Movie mapping
AddCategoryMapping(90, TorznabCatType.MoviesDVD);
AddCategoryMapping(60, TorznabCatType.MoviesDVD);
AddCategoryMapping(89, TorznabCatType.MoviesHD);
AddCategoryMapping(59, TorznabCatType.MoviesHD);
AddCategoryMapping(73, TorznabCatType.MoviesSD);
AddCategoryMapping(91, TorznabCatType.MoviesSD);
AddCategoryMapping(82, TorznabCatType.MoviesBluRay);
AddCategoryMapping(81, TorznabCatType.MoviesOther);
AddCategoryMapping(68, TorznabCatType.Movies3D);
// Boxsets
AddCategoryMapping(84, TorznabCatType.MoviesSD);
AddCategoryMapping(84, TorznabCatType.MoviesDVD);
AddCategoryMapping(84, TorznabCatType.MoviesHD);
AddCategoryMapping(84, TorznabCatType.MoviesForeign);
AddCategoryMapping(84, TorznabCatType.MoviesWEBDL);
AddCategoryMapping(84, TorznabCatType.MoviesBluRay);
} }
public async Task<IndexerConfigurationStatus> ApplyConfiguration(JToken configJson) public async Task<IndexerConfigurationStatus> ApplyConfiguration(JToken configJson)
@ -107,12 +126,15 @@ namespace Jackett.Indexers
release.MinimumSeedTime = 172800; release.MinimumSeedTime = 172800;
var seriesCats = new[] { 92, 93, 57, 74 }; var seriesCats = new[] { 92, 93, 57, 74 };
var moviesCats = new[] { 90, 60, 89, 59, 73, 91, 82, 81, 68, 84 };
var qCat = row.ChildElements.ElementAt(0).ChildElements.ElementAt(0).Cq(); var qCat = row.ChildElements.ElementAt(0).ChildElements.ElementAt(0).Cq();
var catUrl = qCat.Attr("href"); var catUrl = qCat.Attr("href");
var cat = catUrl.Substring(catUrl.LastIndexOf('[') + 1); var cat = catUrl.Substring(catUrl.LastIndexOf('[') + 1);
var catNo = int.Parse(cat.Trim(']')); var catNo = int.Parse(cat.Trim(']'));
if (seriesCats.Contains(catNo)) if (seriesCats.Contains(catNo))
release.Category = TorznabCatType.TV.ID; release.Category = TorznabCatType.TV.ID;
else if (moviesCats.Contains(catNo))
release.Category = TorznabCatType.Movies.ID;
else else
continue; continue;