mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
AnimeBytes: Add option to add a release based on filename (#13633)
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Collections.Specialized;
|
using System.Collections.Specialized;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@@ -28,6 +29,7 @@ namespace Jackett.Common.Indexers
|
|||||||
private bool AddJapaneseTitle => ConfigData.AddJapaneseTitle.Value;
|
private bool AddJapaneseTitle => ConfigData.AddJapaneseTitle.Value;
|
||||||
private bool AddRomajiTitle => ConfigData.AddRomajiTitle.Value;
|
private bool AddRomajiTitle => ConfigData.AddRomajiTitle.Value;
|
||||||
private bool AddAlternativeTitles => ConfigData.AddAlternativeTitles.Value;
|
private bool AddAlternativeTitles => ConfigData.AddAlternativeTitles.Value;
|
||||||
|
private bool AddFileNameTitles => ConfigData.AddFileNameTitles.Value;
|
||||||
private bool FilterSeasonEpisode => ConfigData.FilterSeasonEpisode.Value;
|
private bool FilterSeasonEpisode => ConfigData.FilterSeasonEpisode.Value;
|
||||||
|
|
||||||
private ConfigurationDataAnimeBytes ConfigData => (ConfigurationDataAnimeBytes)configData;
|
private ConfigurationDataAnimeBytes ConfigData => (ConfigurationDataAnimeBytes)configData;
|
||||||
@@ -395,6 +397,36 @@ namespace Jackett.Common.Indexers
|
|||||||
|
|
||||||
releases.Add(release);
|
releases.Add(release);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (AddFileNameTitles && (int)torrent["FileCount"] == 1)
|
||||||
|
{
|
||||||
|
var releaseTitle = Path.GetFileNameWithoutExtension((string)torrent["FileList"][0]["filename"]);
|
||||||
|
|
||||||
|
var guid = new Uri(details + "&nh=" + StringUtil.Hash(releaseTitle));
|
||||||
|
var release = new ReleaseInfo
|
||||||
|
{
|
||||||
|
MinimumRatio = 1,
|
||||||
|
MinimumSeedTime = minimumSeedTime,
|
||||||
|
Title = releaseTitle,
|
||||||
|
Details = details,
|
||||||
|
Guid = guid,
|
||||||
|
Link = linkUri,
|
||||||
|
Poster = poster,
|
||||||
|
PublishDate = publishDate,
|
||||||
|
Category = category,
|
||||||
|
Description = description,
|
||||||
|
Size = size,
|
||||||
|
Seeders = seeders,
|
||||||
|
Peers = peers,
|
||||||
|
Grabs = snatched,
|
||||||
|
Files = fileCount,
|
||||||
|
DownloadVolumeFactor = rawDownMultiplier,
|
||||||
|
UploadVolumeFactor = rawUpMultiplier
|
||||||
|
};
|
||||||
|
|
||||||
|
releases.Add(release);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -11,6 +11,7 @@ namespace Jackett.Common.Models.IndexerConfig.Bespoke
|
|||||||
public BoolConfigurationItem AddJapaneseTitle { get; private set; }
|
public BoolConfigurationItem AddJapaneseTitle { get; private set; }
|
||||||
public BoolConfigurationItem AddRomajiTitle { get; private set; }
|
public BoolConfigurationItem AddRomajiTitle { get; private set; }
|
||||||
public BoolConfigurationItem AddAlternativeTitles { get; private set; }
|
public BoolConfigurationItem AddAlternativeTitles { get; private set; }
|
||||||
|
public BoolConfigurationItem AddFileNameTitles { get; private set; }
|
||||||
public BoolConfigurationItem FilterSeasonEpisode { get; private set; }
|
public BoolConfigurationItem FilterSeasonEpisode { get; private set; }
|
||||||
|
|
||||||
public ConfigurationDataAnimeBytes(string instructionMessageOptional = null)
|
public ConfigurationDataAnimeBytes(string instructionMessageOptional = null)
|
||||||
@@ -22,6 +23,7 @@ namespace Jackett.Common.Models.IndexerConfig.Bespoke
|
|||||||
AddJapaneseTitle = new BoolConfigurationItem("Add releases for Japanese Title") { Value = false };
|
AddJapaneseTitle = new BoolConfigurationItem("Add releases for Japanese Title") { Value = false };
|
||||||
AddRomajiTitle = new BoolConfigurationItem("Add releases for Romaji Title") { Value = false };
|
AddRomajiTitle = new BoolConfigurationItem("Add releases for Romaji Title") { Value = false };
|
||||||
AddAlternativeTitles = new BoolConfigurationItem("Add releases for Alternative Title(s)") { Value = false };
|
AddAlternativeTitles = new BoolConfigurationItem("Add releases for Alternative Title(s)") { Value = false };
|
||||||
|
AddFileNameTitles = new BoolConfigurationItem("Add releases based on single filename") { Value = false };
|
||||||
FilterSeasonEpisode = new BoolConfigurationItem("Filter results by season/episode") { Value = false };
|
FilterSeasonEpisode = new BoolConfigurationItem("Filter results by season/episode") { Value = false };
|
||||||
Instructions = new DisplayInfoConfigurationItem("", instructionMessageOptional);
|
Instructions = new DisplayInfoConfigurationItem("", instructionMessageOptional);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user