Skip to content

Commit

Permalink
Fixed: Unset variable in CardigannIndexer if it's missing in the row (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ta264 committed Aug 12, 2020
1 parent 5a856b2 commit 37a9d6b
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 20 deletions.
2 changes: 0 additions & 2 deletions src/Jackett.Common/Definitions/btgigs.yml
Expand Up @@ -79,8 +79,6 @@ search:
rows:
selector: table[border="1"][cellpadding=5] > tbody > tr:has(a[href^="details.php?id="])
fields:
is_polish: # Workaround: https://github.com/Jackett/Jackett/issues/8068#issuecomment-610222414
text: ""
is_polish:
optional: true
selector: img[src*="cat_pl"]
Expand Down
2 changes: 0 additions & 2 deletions src/Jackett.Common/Definitions/hdspain.yml
Expand Up @@ -61,8 +61,6 @@ search:
filters:
- name: querystring
args: cat
extras:
text: ""
extras:
optional: true
selector: td.titulo a[class]
Expand Down
6 changes: 0 additions & 6 deletions src/Jackett.Common/Definitions/karagarga.yml
Expand Up @@ -118,21 +118,15 @@ search:
selector: td:nth-child(13)
leechers:
selector: td:nth-child(14)
subs:
text: ""
subs:
selector: span:contains("Subs:")
optional: true
genre:
text: ""
genre:
selector: td:nth-child(5)
optional: true
filters:
- name: prepend
args: "Genre: "
mom:
text: ""
mom:
selector: img[title^="CURRENT"]
attribute: title
Expand Down
6 changes: 0 additions & 6 deletions src/Jackett.Common/Definitions/onejav.yml
Expand Up @@ -42,24 +42,18 @@ search:
selector: img
attribute: src
optional: true
actress:
text: ""
actress:
selector: a[href^="/actress/"]
optional: true
filters:
- name: prepend
args: "Actress: "
tags:
text: ""
tags:
selector: div.tags
optional: true
filters:
- name: prepend
args: "Tags: "
descr:
text: ""
descr:
selector: p.level
optional: true
Expand Down
2 changes: 0 additions & 2 deletions src/Jackett.Common/Definitions/torrentleech-pl.yml
Expand Up @@ -136,8 +136,6 @@ search:
optional: true
selector: a[href*="imdb.com/title/tt"]
attribute: href
description:
text: ""
description:
optional: true
selector: img[src="pic/pl.jpg"]
Expand Down
7 changes: 5 additions & 2 deletions src/Jackett.Common/Indexers/CardigannIndexer.cs
Expand Up @@ -37,7 +37,7 @@ private new ConfigurationData configData
set => base.configData = value;
}

protected readonly string[] OptionalFileds = new string[] { "imdb", "rageid", "tvdbid", "banner" };
protected readonly string[] OptionalFields = new string[] { "imdb", "rageid", "tvdbid", "banner" };

private static readonly string[] _SupportedLogicFunctions =
{
Expand Down Expand Up @@ -1587,8 +1587,11 @@ protected override async Task<IEnumerable<ReleaseInfo>> PerformQuery(TorznabQuer
{
if (!variables.ContainsKey(variablesKey))
variables[variablesKey] = null;
if (OptionalFileds.Contains(Field.Key) || FieldModifiers.Contains("optional") || Field.Value.Optional)
if (OptionalFields.Contains(Field.Key) || FieldModifiers.Contains("optional") || Field.Value.Optional)
{
variables[variablesKey] = null;
continue;
}
throw new Exception(string.Format("Error while parsing field={0}, selector={1}, value={2}: {3}", Field.Key, Field.Value.Selector, (value == null ? "<null>" : value), ex.Message));
}
}
Expand Down

0 comments on commit 37a9d6b

Please sign in to comment.