AnimeBytes: more fixes

This commit is contained in:
kaso17
2018-04-27 16:52:21 +02:00
parent 08ad94a2f5
commit 2d0e82159d

View File

@@ -26,9 +26,6 @@ namespace Jackett.Common.Indexers
public bool AddSynonyms { get { return configData.AddSynonyms.Value; } } public bool AddSynonyms { get { return configData.AddSynonyms.Value; } }
public bool FilterSeasonEpisode { get { return configData.FilterSeasonEpisode.Value; } } public bool FilterSeasonEpisode { get { return configData.FilterSeasonEpisode.Value; } }
string csrfIndex = null;
string csrfToken = null;
private new ConfigurationDataAnimeBytes configData private new ConfigurationDataAnimeBytes configData
{ {
get { return (ConfigurationDataAnimeBytes)base.configData; } get { return (ConfigurationDataAnimeBytes)base.configData; }
@@ -170,6 +167,10 @@ namespace Jackett.Common.Indexers
if (json["error"] != null) if (json["error"] != null)
throw new Exception(json["error"].ToString()); throw new Exception(json["error"].ToString());
var Matches = (long)json["Matches"];
if(Matches > 0)
{
var groups = (JArray)json.Groups; var groups = (JArray)json.Groups;
foreach (JObject group in groups) foreach (JObject group in groups)
@@ -249,7 +250,6 @@ namespace Jackett.Common.Indexers
continue; continue;
} }
var torrentID = (long)torrent["ID"]; var torrentID = (long)torrent["ID"];
logger.Error(torrentID);
var Property = (string)torrent["Property"]; var Property = (string)torrent["Property"];
Property = Property.Replace(" | Freeleech", ""); Property = Property.Replace(" | Freeleech", "");
var Link = (string)torrent["Link"]; var Link = (string)torrent["Link"];
@@ -275,13 +275,13 @@ namespace Jackett.Common.Indexers
if (searchType == "anime") if (searchType == "anime")
{ {
if (category == "TV Series") if (GroupName == "TV Series")
Category = new List<int> { TorznabCatType.TVAnime.ID }; Category = new List<int> { TorznabCatType.TVAnime.ID };
// Ignore these categories as they'll cause hell with the matcher // Ignore these categories as they'll cause hell with the matcher
// TV Special, OVA, ONA, DVD Special, BD Special // TV Special, OVA, ONA, DVD Special, BD Special
if (category == "Movie") if (GroupName == "Movie")
Category = new List<int> { TorznabCatType.Movies.ID }; Category = new List<int> { TorznabCatType.Movies.ID };
if (category == "Manga" || category == "Oneshot" || category == "Anthology" || category == "Manhwa" || category == "Manhua" || category == "Light Novel") if (category == "Manga" || category == "Oneshot" || category == "Anthology" || category == "Manhwa" || category == "Manhua" || category == "Light Novel")
@@ -357,10 +357,9 @@ namespace Jackett.Common.Indexers
foreach (var title in synonyms) foreach (var title in synonyms)
{ {
string releaseTitle = null; string releaseTitle = null;
if (category == "Movie") if (GroupName == "Movie")
{ {
var year = 0; releaseTitle = string.Format("{0} {1} {2}{3}", title, Year, releasegroup, infoString);
releaseTitle = string.Format("{0} {1} {2}{3}", title, year, group, infoString);
} }
else else
{ {
@@ -391,6 +390,7 @@ namespace Jackett.Common.Indexers
} }
} }
} }
}
catch (Exception ex) catch (Exception ex)
{ {
OnParseError(response.Content, ex); OnParseError(response.Content, ex);