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,7 +60,26 @@ 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,16 +126,19 @@ 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 else if (moviesCats.Contains(catNo))
continue; release.Category = TorznabCatType.Movies.ID;
else
var qAdded = row.ChildElements.ElementAt(4).ChildElements.ElementAt(0).Cq(); continue;
var qAdded = row.ChildElements.ElementAt(4).ChildElements.ElementAt(0).Cq();
var addedStr = qAdded.Attr("title"); var addedStr = qAdded.Attr("title");
release.PublishDate = DateTime.ParseExact(addedStr, "MMM dd yyyy, HH:mm", CultureInfo.InvariantCulture); release.PublishDate = DateTime.ParseExact(addedStr, "MMM dd yyyy, HH:mm", CultureInfo.InvariantCulture);