mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
AnimeBytes Sonarr Fix (Will only fix season 1 but we don't have season info).
This commit is contained in:
@@ -27,6 +27,7 @@ namespace Jackett.Indexers
|
|||||||
private string LoginUrl { get { return SiteLink + "user/login"; } }
|
private string LoginUrl { get { return SiteLink + "user/login"; } }
|
||||||
private string SearchUrl { get { return SiteLink + "torrents.php?"; } }
|
private string SearchUrl { get { return SiteLink + "torrents.php?"; } }
|
||||||
public bool AllowRaws { get { return configData.IncludeRaw.Value; } }
|
public bool AllowRaws { get { return configData.IncludeRaw.Value; } }
|
||||||
|
public bool InsertSeason { get { return configData.InsertSeason!=null && configData.InsertSeason.Value; } }
|
||||||
|
|
||||||
new ConfigurationDataAnimeBytes configData
|
new ConfigurationDataAnimeBytes configData
|
||||||
{
|
{
|
||||||
@@ -53,6 +54,13 @@ namespace Jackett.Indexers
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public IEnumerable<ReleaseInfo> FilterResults(TorznabQuery query, IEnumerable<ReleaseInfo> input)
|
||||||
|
{
|
||||||
|
// Prevent filtering
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
|
||||||
public async Task<IndexerConfigurationStatus> ApplyConfiguration(JToken configJson)
|
public async Task<IndexerConfigurationStatus> ApplyConfiguration(JToken configJson)
|
||||||
{
|
{
|
||||||
configData.LoadValuesFromJson(configJson);
|
configData.LoadValuesFromJson(configJson);
|
||||||
@@ -122,7 +130,9 @@ namespace Jackett.Indexers
|
|||||||
private string StripEpisodeNumber(string term)
|
private string StripEpisodeNumber(string term)
|
||||||
{
|
{
|
||||||
// Tracer does not support searching with episode number so strip it if we have one
|
// Tracer does not support searching with episode number so strip it if we have one
|
||||||
return Regex.Replace(term, @"\W(\dx)?\d?\d$", string.Empty);
|
term = Regex.Replace(term, @"\W(\dx)?\d?\d$", string.Empty);
|
||||||
|
term = Regex.Replace(term, @"\W(S\d\d?E)?\d?\d$", string.Empty);
|
||||||
|
return term;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<IEnumerable<ReleaseInfo>> PerformQuery(TorznabQuery query)
|
public async Task<IEnumerable<ReleaseInfo>> PerformQuery(TorznabQuery query)
|
||||||
@@ -242,6 +252,12 @@ namespace Jackett.Indexers
|
|||||||
releaseInfo = releaseInfo.Replace("Episode ", "");
|
releaseInfo = releaseInfo.Replace("Episode ", "");
|
||||||
releaseInfo = releaseInfo.Replace("Season ", "S");
|
releaseInfo = releaseInfo.Replace("Season ", "S");
|
||||||
releaseInfo = releaseInfo.Trim();
|
releaseInfo = releaseInfo.Trim();
|
||||||
|
int test = 0;
|
||||||
|
if (InsertSeason && int.TryParse(releaseInfo, out test) && releaseInfo.Length==1)
|
||||||
|
{
|
||||||
|
releaseInfo = "S01E0" + releaseInfo;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (rowCq.HasClass("torrent"))
|
else if (rowCq.HasClass("torrent"))
|
||||||
{
|
{
|
||||||
|
@@ -11,12 +11,14 @@ namespace Jackett.Models.IndexerConfig.Bespoke
|
|||||||
{
|
{
|
||||||
public BoolItem IncludeRaw { get; private set; }
|
public BoolItem IncludeRaw { get; private set; }
|
||||||
public DisplayItem DateWarning { get; private set; }
|
public DisplayItem DateWarning { get; private set; }
|
||||||
|
public BoolItem InsertSeason { get; private set; }
|
||||||
|
|
||||||
public ConfigurationDataAnimeBytes()
|
public ConfigurationDataAnimeBytes()
|
||||||
: base()
|
: base()
|
||||||
{
|
{
|
||||||
IncludeRaw = new BoolItem() { Name = "IncludeRaw", Value = false };
|
IncludeRaw = new BoolItem() { Name = "IncludeRaw", Value = false };
|
||||||
DateWarning = new DisplayItem("This tracker does not supply upload dates so they are based off year of release.") { Name = "DateWarning" };
|
DateWarning = new DisplayItem("This tracker does not supply upload dates so they are based off year of release.") { Name = "DateWarning" };
|
||||||
|
InsertSeason = new BoolItem() { Name = "Prefix episode number with S01 for Sonarr Compatability", Value = false };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user