mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
hdbits: add use filename options and set empty default values for codec, medium and origin
This commit is contained in:
@@ -4,6 +4,7 @@ using System.Diagnostics.CodeAnalysis;
|
|||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Jackett.Common.Extensions;
|
||||||
using Jackett.Common.Models;
|
using Jackett.Common.Models;
|
||||||
using Jackett.Common.Models.IndexerConfig.Bespoke;
|
using Jackett.Common.Models.IndexerConfig.Bespoke;
|
||||||
using Jackett.Common.Services.Interfaces;
|
using Jackett.Common.Services.Interfaces;
|
||||||
@@ -177,7 +178,8 @@ namespace Jackett.Common.Indexers
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var title = (string)r["name"];
|
var title = GetTitle(r);
|
||||||
|
|
||||||
// if tv then match query keywords against title #12753
|
// if tv then match query keywords against title #12753
|
||||||
if (!query.IsImdbQuery && !query.MatchQueryStringAND(title))
|
if (!query.IsImdbQuery && !query.MatchQueryStringAND(title))
|
||||||
{
|
{
|
||||||
@@ -223,6 +225,16 @@ namespace Jackett.Common.Indexers
|
|||||||
return releases;
|
return releases;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string GetTitle(JObject item)
|
||||||
|
{
|
||||||
|
var filename = (string)item["filename"];
|
||||||
|
var name = (string)item["name"];
|
||||||
|
|
||||||
|
return configData.UseFilenames.Value && filename.IsNotNullOrWhiteSpace()
|
||||||
|
? filename.Replace(".torrent", "")
|
||||||
|
: name;
|
||||||
|
}
|
||||||
|
|
||||||
private static double GetUploadFactor(JObject r) => (int)r["type_category"] == 7 ? 0 : 1;
|
private static double GetUploadFactor(JObject r) => (int)r["type_category"] == 7 ? 0 : 1;
|
||||||
|
|
||||||
private static double GetDownloadFactor(JObject r)
|
private static double GetDownloadFactor(JObject r)
|
||||||
|
@@ -10,6 +10,7 @@ namespace Jackett.Common.Models.IndexerConfig.Bespoke
|
|||||||
public MultiSelectConfigurationItem Mediums { get; private set; }
|
public MultiSelectConfigurationItem Mediums { get; private set; }
|
||||||
public MultiSelectConfigurationItem Origins { get; private set; }
|
public MultiSelectConfigurationItem Origins { get; private set; }
|
||||||
public BoolConfigurationItem FilterFreeleech { get; private set; }
|
public BoolConfigurationItem FilterFreeleech { get; private set; }
|
||||||
|
public BoolConfigurationItem UseFilenames { get; private set; }
|
||||||
|
|
||||||
public ConfigurationDataHDBitsApi()
|
public ConfigurationDataHDBitsApi()
|
||||||
{
|
{
|
||||||
@@ -18,7 +19,14 @@ namespace Jackett.Common.Models.IndexerConfig.Bespoke
|
|||||||
Value = false
|
Value = false
|
||||||
};
|
};
|
||||||
|
|
||||||
Codecs = new MultiSelectConfigurationItem("Codec", new Dictionary<string, string>()
|
UseFilenames = new BoolConfigurationItem("Use Filenames as release titles")
|
||||||
|
{
|
||||||
|
Value = false
|
||||||
|
};
|
||||||
|
|
||||||
|
Codecs = new MultiSelectConfigurationItem(
|
||||||
|
"Codec",
|
||||||
|
new Dictionary<string, string>
|
||||||
{
|
{
|
||||||
{ "0", "Undefined" },
|
{ "0", "Undefined" },
|
||||||
{ "1", "H.264" },
|
{ "1", "H.264" },
|
||||||
@@ -27,10 +35,11 @@ namespace Jackett.Common.Models.IndexerConfig.Bespoke
|
|||||||
{ "3", "VC-1" },
|
{ "3", "VC-1" },
|
||||||
{ "6", "VP9" },
|
{ "6", "VP9" },
|
||||||
{ "4", "XviD" }
|
{ "4", "XviD" }
|
||||||
})
|
});
|
||||||
{ Values = new[] { "0", "1", "5", "2", "3", "6", "4" } };
|
|
||||||
|
|
||||||
Mediums = new MultiSelectConfigurationItem("Medium", new Dictionary<string, string>()
|
Mediums = new MultiSelectConfigurationItem(
|
||||||
|
"Medium",
|
||||||
|
new Dictionary<string, string>
|
||||||
{
|
{
|
||||||
{ "0", "Undefined" },
|
{ "0", "Undefined" },
|
||||||
{ "1", "Blu-ray/HD DVD" },
|
{ "1", "Blu-ray/HD DVD" },
|
||||||
@@ -38,15 +47,15 @@ namespace Jackett.Common.Models.IndexerConfig.Bespoke
|
|||||||
{ "3", "Encode" },
|
{ "3", "Encode" },
|
||||||
{ "5", "Remux" },
|
{ "5", "Remux" },
|
||||||
{ "6", "WEB-DL" }
|
{ "6", "WEB-DL" }
|
||||||
})
|
});
|
||||||
{ Values = new[] { "0", "1", "4", "3", "5", "6" } };
|
|
||||||
|
|
||||||
Origins = new MultiSelectConfigurationItem("Origin", new Dictionary<string, string>()
|
Origins = new MultiSelectConfigurationItem(
|
||||||
|
"Origin",
|
||||||
|
new Dictionary<string, string>
|
||||||
{
|
{
|
||||||
{ "0", "Undefined" },
|
{ "0", "Undefined" },
|
||||||
{ "1", "Internal" }
|
{ "1", "Internal" }
|
||||||
})
|
});
|
||||||
{ Values = new[] { "0", "1" } };
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user