1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-26 09:49:00 +00:00

Added: AHD_Internal and G_Scene indexer flags. Also linked a wiki page with more information about indexer flags.

Fixes #203 Fixes #1519
This commit is contained in:
Leonardo Galli 2018-05-27 11:05:23 +02:00
parent d05fb8ee33
commit b60ddf62e8
14 changed files with 93 additions and 46 deletions

View file

@ -1,21 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ContentModelStore">
<e p="$PROJECT_DIR$/../_output" t="ExcludeRecursive">
<e p="E:\C++ Projects\Sonarr\_output" t="ExcludeRecursive">
<e p="NzbDrone.Update" t="ExcludeRecursive" />
</e>
<e p="$PROJECT_DIR$/../Logo/1024.png" t="Include" />
<e p="$PROJECT_DIR$/../Logo/64.png" t="Include" />
<e p="$PROJECT_DIR$" t="IncludeFlat">
<e p="E:\C++ Projects\Sonarr\Logo\1024.png" t="Include" />
<e p="E:\C++ Projects\Sonarr\Logo\64.png" t="Include" />
<e p="E:\C++ Projects\Sonarr\src" t="IncludeFlat">
<e p=".nuget" t="Include">
<e p="NuGet.exe" t="Include" />
</e>
<e p="_ReSharper.Caches/ReSharperHost12.NzbDrone.00" t="ExcludeRecursive" />
<e p="Common/CommonAssemblyInfo.cs" t="Include" />
<e p="Common/CommonVersionInfo.cs" t="Include" />
<e p="Common/GlobalSuppressions.cs" t="Include" />
<e p="_ReSharper.Caches\ReSharperHost11.NzbDrone.00" t="ExcludeRecursive" />
<e p="Common" t="Include">
<e p="CodeAnalysisDictionary.xml" t="Include" />
<e p="CommonAssemblyInfo.cs" t="Include" />
<e p="CommonVersionInfo.cs" t="Include" />
<e p="GlobalSuppressions.cs" t="Include" />
</e>
<e p="External" t="Include" />
<e p="ExternalModules/CurlSharp/CurlSharp" t="IncludeRecursive">
<e p="ExternalModules\CurlSharp\CurlSharp" t="IncludeRecursive">
<e p="bin" t="ExcludeRecursive" />
<e p="Callbacks" t="Include">
<e p="CurlEasyCallbacks.cs" t="Include" />
@ -67,10 +70,10 @@
</e>
</e>
<e p="Host" t="Include" />
<e p="Libraries/MediaInfo/libmediainfo.0.dylib" t="Include" />
<e p="Libraries/MediaInfo/MediaInfo.dll" t="Include" />
<e p="Libraries/Sqlite/libsqlite3.0.dylib" t="Include" />
<e p="Libraries/Sqlite/sqlite3.dll" t="Include" />
<e p="Libraries\MediaInfo\libmediainfo.0.dylib" t="Include" />
<e p="Libraries\MediaInfo\MediaInfo.dll" t="Include" />
<e p="Libraries\Sqlite\libsqlite3.0.dylib" t="Include" />
<e p="Libraries\Sqlite\sqlite3.dll" t="Include" />
<e p="LogentriesCore" t="IncludeRecursive">
<e p="AsyncLogger.cs" t="Include" />
<e p="bin" t="ExcludeRecursive" />
@ -1333,6 +1336,7 @@
<e p="144_add_cookies_to_indexer_status.cs" t="Include" />
<e p="145_banner_to_fanart.cs" t="Include" />
<e p="146_naming_config_colon_replacement_format.cs" t="Include" />
<e p="148_remove_extra_naming_config.cs" t="Include" />
<e p="Framework" t="Include">
<e p="MigrationContext.cs" t="Include" />
<e p="MigrationController.cs" t="Include" />
@ -3292,7 +3296,7 @@
</e>
<e p="packages" t="ExcludeRecursive" />
<e p="Platform" t="Include" />
<e p="ServiceHelpers/ServiceInstall" t="IncludeRecursive">
<e p="ServiceHelpers\ServiceInstall" t="IncludeRecursive">
<e p="app.config" t="Include" />
<e p="app.manifest" t="Include" />
<e p="green_puzzle.ico" t="Include" />
@ -3304,7 +3308,7 @@
<e p="ServiceHelper.cs" t="Include" />
<e p="ServiceInstall.csproj" t="IncludeRecursive" />
</e>
<e p="ServiceHelpers/ServiceUninstall" t="IncludeRecursive">
<e p="ServiceHelpers\ServiceUninstall" t="IncludeRecursive">
<e p="app.config" t="Include" />
<e p="app.manifest" t="Include" />
<e p="obj" t="ExcludeRecursive" />

View file

@ -62,6 +62,8 @@ public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
Subtitles = x.Element("subtitles").Value,
EncodeStatus = x.Element("encodestatus").Value,
Freeleech = x.Element("freeleech").Value,
Internal = x.Element("internal").Value == "1",
UserRelease = x.Element("userrelease").Value == "1",
ImdbId = x.Element("imdb").Value
}).ToList();
@ -71,16 +73,31 @@ public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
var title = $"{torrent.Name}.{torrent.Year}.{torrent.Resolution}.{torrent.Media}.{torrent.Encoding}.{torrent.AudioFormat}-{torrent.ReleaseGroup}";
IndexerFlags flags = 0;
if (torrent.Freeleech == "0.00" || torrent.Freeleech == "0.25")
if (torrent.Freeleech == "0.00")
{
flags |= IndexerFlags.G_Freeleech;
}
if (torrent.Freeleech == "0.25")
{
flags |= IndexerFlags.G_Freeleech75;
}
if (torrent.Freeleech == "0.75")
{
flags |= IndexerFlags.G_Freeleech25;
}
if (torrent.Freeleech == "0.50")
{
flags |= IndexerFlags.G_Halfleech;
}
if (torrent.Internal)
{
flags |= IndexerFlags.AHD_Internal;
}
torrentInfos.Add(new TorrentInfo()
{
Guid = string.Format("AwesomeHD-{0}", id),

View file

@ -34,8 +34,8 @@ public AwesomeHDSettings()
[FieldDefinition(2, Type = FieldType.Textbox, Label = "Minimum Seeders", HelpText = "Minimum number of seeders required.", Advanced = true)]
public int MinimumSeeders { get; set; }
[FieldDefinition(3, Type = FieldType.Tag, SelectOptions = typeof(IndexerFlags), Label = "Required Flags", HelpText = "What indexer flags are required?", Advanced = true)]
[FieldDefinition(3, Type = FieldType.Tag, SelectOptions = typeof(IndexerFlags), Label = "Required Flags", HelpText = "What indexer flags are required?", HelpLink = "https://github.com/Radarr/Radarr/wiki/Indexer-Flags#1-required-flags", Advanced = true)]
public IEnumerable<int> RequiredFlags { get; set; }
public NzbDroneValidationResult Validate()

View file

@ -53,8 +53,8 @@ public HDBitsSettings()
[FieldDefinition(6, Type = FieldType.Textbox, Label = "Minimum Seeders", HelpText = "Minimum number of seeders required.", Advanced = true)]
public int MinimumSeeders { get; set; }
[FieldDefinition(7, Type = FieldType.Tag, SelectOptions = typeof(IndexerFlags), Label = "Required Flags", HelpText = "What indexer flags are required?", Advanced = true)]
[FieldDefinition(7, Type = FieldType.Tag, SelectOptions = typeof(IndexerFlags), Label = "Required Flags", HelpText = "What indexer flags are required?", HelpLink = "https://github.com/Radarr/Radarr/wiki/Indexer-Flags#1-required-flags", Advanced = true)]
public IEnumerable<int> RequiredFlags { get; set; }
public NzbDroneValidationResult Validate()

View file

@ -38,8 +38,8 @@ public IPTorrentsSettings()
[FieldDefinition(1, Type = FieldType.Textbox, Label = "Minimum Seeders", HelpText = "Minimum number of seeders required.", Advanced = true)]
public int MinimumSeeders { get; set; }
[FieldDefinition(2, Type = FieldType.Tag, SelectOptions = typeof(IndexerFlags), Label = "Required Flags", HelpText = "What indexer flags are required?", Advanced = true)]
[FieldDefinition(2, Type = FieldType.Tag, SelectOptions = typeof(IndexerFlags), Label = "Required Flags", HelpText = "What indexer flags are required?", HelpLink = "https://github.com/Radarr/Radarr/wiki/Indexer-Flags#1-required-flags", Advanced = true)]
public IEnumerable<int> RequiredFlags { get; set; }
public NzbDroneValidationResult Validate()

View file

@ -35,8 +35,8 @@ public NyaaSettings()
[FieldDefinition(2, Type = FieldType.Textbox, Label = "Minimum Seeders", HelpText = "Minimum number of seeders required.", Advanced = true)]
public int MinimumSeeders { get; set; }
[FieldDefinition(3, Type = FieldType.Tag, SelectOptions = typeof(IndexerFlags), Label = "Required Flags", HelpText = "What indexer flags are required?", Advanced = true)]
[FieldDefinition(3, Type = FieldType.Tag, SelectOptions = typeof(IndexerFlags), Label = "Required Flags", HelpText = "What indexer flags are required?", HelpLink = "https://github.com/Radarr/Radarr/wiki/Indexer-Flags#1-required-flags", Advanced = true)]
public IEnumerable<int> RequiredFlags { get; set; }
public NzbDroneValidationResult Validate()
@ -44,4 +44,4 @@ public NzbDroneValidationResult Validate()
return new NzbDroneValidationResult(Validator.Validate(this));
}
}
}
}

View file

@ -81,6 +81,11 @@ public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
flags |= IndexerFlags.G_Freeleech;
}
if (torrent.Scene)
{
flags |= IndexerFlags.G_Scene;
}
// Only add approved torrents
try
{
@ -113,7 +118,7 @@ public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
"}. Please immediately report this info on https://github.com/Radarr/Radarr/issues/1584.");
throw;
}
}
}

View file

@ -43,8 +43,8 @@ public PassThePopcornSettings()
[FieldDefinition(4, Type = FieldType.Textbox, Label = "Minimum Seeders", HelpText = "Minimum number of seeders required.", Advanced = true)]
public int MinimumSeeders { get; set; }
[FieldDefinition(5, Type = FieldType.Tag, SelectOptions = typeof(IndexerFlags), Label = "Required Flags", HelpText = "What indexer flags are required?", Advanced = true)]
[FieldDefinition(5, Type = FieldType.Tag, SelectOptions = typeof(IndexerFlags), Label = "Required Flags", HelpText = "What indexer flags are required?", HelpLink = "https://github.com/Radarr/Radarr/wiki/Indexer-Flags#1-required-flags", Advanced = true)]
public IEnumerable<int> RequiredFlags { get; set; }
public NzbDroneValidationResult Validate()

View file

@ -30,14 +30,14 @@ public RarbgSettings()
[FieldDefinition(1, Type = FieldType.Checkbox, Label = "Ranked Only", HelpText = "Only include ranked results.")]
public bool RankedOnly { get; set; }
[FieldDefinition(2, Type = FieldType.Captcha, Label = "CAPTCHA Token", HelpText = "CAPTCHA Clearance token used to handle CloudFlare Anti-DDOS measures on shared-ip VPNs.")]
public string CaptchaToken { get; set; }
[FieldDefinition(3, Type = FieldType.Textbox, Label = "Minimum Seeders", HelpText = "Minimum number of seeders required.", Advanced = true)]
public int MinimumSeeders { get; set; }
[FieldDefinition(4, Type = FieldType.Tag, SelectOptions = typeof(IndexerFlags), Label = "Required Flags", HelpText = "What indexer flags are required?", Advanced = true)]
[FieldDefinition(4, Type = FieldType.Tag, SelectOptions = typeof(IndexerFlags), Label = "Required Flags", HelpText = "What indexer flags are required?", HelpLink = "https://github.com/Radarr/Radarr/wiki/Indexer-Flags#1-required-flags", Advanced = true)]
public IEnumerable<int> RequiredFlags { get; set; }
public NzbDroneValidationResult Validate()
@ -45,4 +45,4 @@ public NzbDroneValidationResult Validate()
return new NzbDroneValidationResult(Validator.Validate(this));
}
}
}
}

View file

@ -36,8 +36,8 @@ public TorrentRssIndexerSettings()
[FieldDefinition(3, Type = FieldType.Textbox, Label = "Minimum Seeders", HelpText = "Minimum number of seeders required.", Advanced = true)]
public int MinimumSeeders { get; set; }
[FieldDefinition(4, Type = FieldType.Tag, SelectOptions = typeof(IndexerFlags), Label = "Required Flags", HelpText = "What indexer flags are required?", Advanced = true)]
[FieldDefinition(4, Type = FieldType.Tag, SelectOptions = typeof(IndexerFlags), Label = "Required Flags", HelpText = "What indexer flags are required?", HelpLink = "https://github.com/Radarr/Radarr/wiki/Indexer-Flags#1-required-flags", Advanced = true)]
public IEnumerable<int> RequiredFlags { get; set; }
public NzbDroneValidationResult Validate()
@ -45,4 +45,4 @@ public NzbDroneValidationResult Validate()
return new NzbDroneValidationResult(validator.Validate(this));
}
}
}
}

View file

@ -60,8 +60,8 @@ public TorznabSettings()
[FieldDefinition(7, Type = FieldType.Textbox, Label = "Minimum Seeders", HelpText = "Minimum number of seeders required.", Advanced = true)]
public int MinimumSeeders { get; set; }
[FieldDefinition(8, Type = FieldType.Tag, SelectOptions = typeof(IndexerFlags), Label = "Required Flags", HelpText = "What indexer flags are required?", Advanced = true)]
[FieldDefinition(8, Type = FieldType.Tag, SelectOptions = typeof(IndexerFlags), Label = "Required Flags", HelpText = "What indexer flags are required?", HelpLink = "https://github.com/Radarr/Radarr/wiki/Indexer-Flags#1-required-flags", Advanced = true)]
public IEnumerable<int> RequiredFlags { get; set; }
public override NzbDroneValidationResult Validate()
@ -69,4 +69,4 @@ public override NzbDroneValidationResult Validate()
return new NzbDroneValidationResult(Validator.Validate(this));
}
}
}
}

View file

@ -102,6 +102,10 @@ public enum IndexerFlags
G_DoubleUpload = 4, //General
PTP_Golden = 8, //PTP
PTP_Approved = 16, //PTP
HDB_Internal = 32 //HDBits
HDB_Internal = 32, //HDBits, internal
AHD_Internal = 64, // AHD, internal
G_Scene = 128, //General, the torrent comes from the "scene"
G_Freeleech75 = 256, //Currently only used for AHD, signifies a torrent counts towards 75 percent of your download quota.
G_Freeleech25 = 512 //Currently only used for AHD, signifies a torrent counts towards 25 percent of your download quota.
}
}
}

View file

@ -22,11 +22,11 @@ module.exports = Backgrid.Cell.extend({
switch (flag) {
case "G_Freeleech":
addon = "⬇";
title = "Freeleech";
addon = "⬇";
title = "100% Freeleech";
break;
case "G_Halfleech":
addon = "⇩";
addon = "⇩";
title = "50% Freeleech";
break;
case "G_DoubleUpload":
@ -34,7 +34,7 @@ module.exports = Backgrid.Cell.extend({
title = "Double upload";
break;
case "PTP_Golden":
addon = "🍿";
addon = "🌟";
title = "Golden";
break;
case "PTP_Approved":
@ -42,12 +42,28 @@ module.exports = Backgrid.Cell.extend({
title = "Approved by PTP";
break;
case "HDB_Internal":
addon = "⭐️";
addon = "🚪";
title = "HDBits Internal";
break;
case "G_Scene":
addon = "☠";
title = "Scene Release";
break;
case "AHD_Internal":
addon = "🚪";
title = "AHD Internal";
break;
case "G_Freeleech75":
addon = "⇩⬇";
title = "75% Freeleech";
break;
case "G_Freeleech25":
addon = "⇩";
title = "25% Freeleech";
break;
}
if (addon !== "") {
html += "<span title='{0}'>{1}</span> ".format(title, addon);
html += "<a href='https://github.com/Radarr/Radarr/wiki/Indexer-Flags#supported-flags' target='_blank' style='color: inherit; text-decoration: none;'><span title='{0}'>{1}</span></a>".format(title, addon);
}
});
}

View file

@ -41,6 +41,7 @@
<label class="col-sm-3 control-label">Prefer Special Indexer Flags</label>
<div class="col-sm-1 col-sm-push-2 help-inline">
<i class="icon-sonarr-form-info" title="If set to yes, the more indexer flags (such as Golden, Approved, Internal, Freeleech, Double upload, etc.) a release has the more priorized it will be. Quality and Preferred words would still come first."/>
<a href="https://github.com/Radarr/Radarr/wiki/Indexer-Flags" class="help-link" rel="noreferrer" target="_blank"><i class="icon-sonarr-form-info-link"></i></a>
</div>
<div class="col-sm-2 col-sm-pull-1">
<div class="input-group">