1
0
Fork 0
mirror of https://github.com/Jackett/Jackett synced 2025-02-21 22:07:10 +00:00

xthor: Add accent parameter. resolves #6025 (#6026)

This commit is contained in:
ThomasClemenceau 2019-09-23 02:41:34 +08:00 committed by garfield69
parent 6a25e73536
commit 07360524b9
2 changed files with 23 additions and 7 deletions

View file

@ -80,7 +80,7 @@ namespace Jackett.Common.Indexers
AddCategoryMapping(33, TorznabCatType.MoviesOther, "SPECTACLE");
AddCategoryMapping(31, TorznabCatType.MoviesOther, "ANIMATION");
AddCategoryMapping(9, TorznabCatType.MoviesOther, "VOSTFR");
// Series
AddCategoryMapping(104, TorznabCatType.TVOTHER, "BLURAY");
AddCategoryMapping(13, TorznabCatType.TVOTHER, "PACK VF");
@ -99,7 +99,7 @@ namespace Jackett.Common.Indexers
// Music
AddCategoryMapping(20, TorznabCatType.AudioVideo, "CONCERT");
// Books
AddCategoryMapping(24, TorznabCatType.BooksEbook, "ENOOKS NOVEL");
AddCategoryMapping(96, TorznabCatType.BooksMagazines, "EBOOKS MAGAZINES");
@ -223,9 +223,10 @@ namespace Jackett.Common.Indexers
releases.AddRange(xthorResponse.torrents.Select(torrent =>
{
//issue #3847 replace multi keyword
if(!string.IsNullOrEmpty(ReplaceMulti)){
if (!string.IsNullOrEmpty(ReplaceMulti))
{
System.Text.RegularExpressions.Regex regex = new Regex("(?i)([\\.\\- ])MULTI([\\.\\- ])");
torrent.name = regex.Replace(torrent.name, "$1"+ReplaceMulti+"$2");
torrent.name = regex.Replace(torrent.name, "$1" + ReplaceMulti + "$2");
}
var release = new ReleaseInfo
@ -367,6 +368,11 @@ namespace Jackett.Common.Indexers
parameters.Add("freeleech", "1");
}
if (!string.IsNullOrEmpty(ConfigData.Accent.Value))
{
parameters.Add("accent", ConfigData.Accent.Value);
}
// Building our query -- Cannot use GetQueryString due to UrlEncode (generating wrong category param)
url += "?" + string.Join("&", parameters.AllKeys.Select(a => a + "=" + parameters[a]));
@ -631,6 +637,14 @@ namespace Jackett.Common.Indexers
Output("Validated Setting -- PassKey (auth) => " + ConfigData.PassKey.Value);
}
if (!string.IsNullOrEmpty(ConfigData.Accent.Value) && !string.Equals(ConfigData.Accent.Value, "1") && !string.Equals(ConfigData.Accent.Value, "2"))
{
throw new ExceptionWithConfigData("Only '1' or '2' are available in the Accent parameter.", ConfigData);
}
else
{
Output("Validated Setting -- Accent (audio) => " + ConfigData.Accent.Value);
}
// Check Dev Cache Settings
if (ConfigData.HardDriveCache.Value)
{

View file

@ -5,6 +5,7 @@
public DisplayItem CredentialsWarning { get; private set; }
public StringItem PassKey { get; set; }
public DisplayItem PagesWarning { get; private set; }
public StringItem Accent { get; set; }
public BoolItem Freeleech { get; private set; }
public StringItem ReplaceMulti { get; private set; }
public BoolItem EnhancedAnime { get; private set; }
@ -18,7 +19,8 @@
{
CredentialsWarning = new DisplayItem("<b>Credentials Configuration</b> (<i>Private Tracker</i>),<br /><br /> <ul><li><b>PassKey</b> is your private key on your account</li></ul>") { Name = "Credentials" };
PassKey = new StringItem { Name = "PassKey", Value = "" };
PagesWarning = new DisplayItem("<b>Preferences Configuration</b> (<i>Tweak your search settings</i>),<br /><br /> <ul><li><b>Freeleech Only</b> let you search <u>only</u> for torrents which are marked Freeleech.</li><li><b>Replace MULTI</b>, replace multi keyword in the resultset (leave empty to deactivate)</li><li><b>Enhanced anime search</b>, Enhance sonarr compatibility with Xthor. Only effective on requests with the <u>TVAnime Torznab category</u>.</li></ul>") { Name = "Preferences" };
Accent = new StringItem { Name = "Accent", Value = "" };
PagesWarning = new DisplayItem("<b>Preferences Configuration</b> (<i>Tweak your search settings</i>),<br /><br /> <ul><li><b>Freeleech Only</b> let you search <u>only</u> for torrents which are marked Freeleech.</li><li><b>Replace MULTI</b>, replace multi keyword in the resultset (leave empty to deactivate)</li><li><b>Enhanced anime search</b>, Enhance sonarr compatibility with Xthor. Only effective on requests with the <u>TVAnime Torznab category</u>.</li><li><b>Accent</b> is the french accent you want. 1 for VFF (Truefrench) 2 for VFQ (FRENCH, canada). When one is selected, the other will not be searched.</li></ul>") { Name = "Preferences" };
Freeleech = new BoolItem() { Name = "Freeleech Only (Optional)", Value = false };
ReplaceMulti = new StringItem() { Name = "Replace MULTI", Value = "MULTI.FRENCH" };
EnhancedAnime = new BoolItem() { Name = "Enhanced anime search", Value = false };
@ -26,6 +28,6 @@
DevMode = new BoolItem { Name = "Enable DEV MODE (Developers ONLY)", Value = false };
HardDriveCache = new BoolItem { Name = "Enable HARD DRIVE CACHE (Developers ONLY)", Value = false };
HardDriveCacheKeepTime = new StringItem { Name = "Keep Cached files for (ms)", Value = "300000" };
}
}
}
}
}