From ea1d86f1070dabc1c9113e498254c28381ef1942 Mon Sep 17 00:00:00 2001 From: hallengreenn Date: Mon, 31 Dec 2018 00:51:47 +0100 Subject: [PATCH] Nordicbits - Add support for christmas theme (#4380) Better late than never. All themes are now supported. --- src/Jackett.Common/Indexers/Nordicbits.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Jackett.Common/Indexers/Nordicbits.cs b/src/Jackett.Common/Indexers/Nordicbits.cs index 73084c22a..c62a05eeb 100644 --- a/src/Jackett.Common/Indexers/Nordicbits.cs +++ b/src/Jackett.Common/Indexers/Nordicbits.cs @@ -679,13 +679,21 @@ namespace Jackett.Common.Indexers private CQ FindTorrentRows() { var defaultTheme = new[] { "/templates/1/", "/templates/2/", "/templates/3/", "/templates/4/", "/templates/5/", "/templates/6/", "/templates/11/", "/templates/12/" }; - var oldV2 = new[] { "/templates/7/", "/templates/8/", "/templates/9/", "/templates/10/", "/templates/14/" }; + var oldV2 = new[] { "/templates/7/", "/templates/8/", "/templates/9/", "/templates/10/" }; + var xmas = new[] { "/templates/14/" }; + + if (xmas.Any(_fDom.Document.Body.InnerHTML.Contains)) + { + // Return all occurencis of torrents found + // $('#base_around > table.mainouter > tbody > tr > td.outer > div.article > table > tbody:not(:first) > tr') + return _fDom["#base_around > table.mainouter > tbody > tr > td.outer > div.article > table > tbody:not(:first) > tr"]; + } // template 7 contains a reference to template 2 (logout button), so check for oldV2 first if (oldV2.Any(_fDom.Document.Body.InnerHTML.Contains)) { // Return all occurencis of torrents found - // $('#base_content > table.mainouter > tbody > tr > td.outer > div.article > table > tbody') + // $('#base_content > table.mainouter > tbody > tr > td.outer > div.article > table > tbody > tr:not(:first)') return _fDom["# base_content > table.mainouter > tbody > tr > td.outer > div.article > table > tbody > tr:not(:first)"]; } @@ -695,7 +703,6 @@ namespace Jackett.Common.Indexers // $('#base_content2 > div.article > table > tbody:not(:first) > tr') return _fDom["# base_content2 > div.article > table > tbody:not(:first) > tr"]; } - return _fDom; }