Remove torrent-specific settings from Listenarr sync

Eliminated handling and syncing of torrent-specific fields such as minimum seeders, seed ratio, seed time, discography seed time, and blocklisted torrent hashes from Listenarr indexer configuration. Also removed the related setting from ListenarrSettings and array parsing logic from ListenarrV1Proxy, simplifying the indexer schema handling.
This commit is contained in:
Robbie Davis 2026-01-21 16:32:01 -05:00
parent 28a90d27e0
commit bf8b66431f
3 changed files with 0 additions and 87 deletions

View file

@ -498,49 +498,6 @@ private ListenarrIndexer BuildListenarrIndexer(IndexerDefinition indexer, Indexe
field.Value = JArray.FromObject(indexerCapabilities.Categories.SupportedCategories(Settings.SyncCategories.ToArray()));
}
if (indexer.Protocol == DownloadProtocol.Torrent)
{
var torrentSettings = indexer.Settings as ITorrentIndexerSettings;
var appMinimumSeeders = torrentSettings?.TorrentBaseSettings.AppMinimumSeeders ?? indexer.AppProfile?.Value?.MinimumSeeders ?? 0;
field = listenarrIndexer.Fields.FirstOrDefault(x => x.Name == "minimumSeeders");
if (field != null)
{
field.Value = appMinimumSeeders;
}
field = listenarrIndexer.Fields.FirstOrDefault(x => x.Name == "seedCriteria.seedRatio");
if (field != null)
{
field.Value = torrentSettings?.TorrentBaseSettings.SeedRatio;
}
field = listenarrIndexer.Fields.FirstOrDefault(x => x.Name == "seedCriteria.seedTime");
if (field != null)
{
field.Value = torrentSettings?.TorrentBaseSettings.SeedTime;
}
if (listenarrIndexer.Fields.Any(x => x.Name == "seedCriteria.discographySeedTime"))
{
field = listenarrIndexer.Fields.FirstOrDefault(x => x.Name == "seedCriteria.discographySeedTime");
if (field != null)
{
field.Value = torrentSettings?.TorrentBaseSettings.PackSeedTime ?? torrentSettings?.TorrentBaseSettings.SeedTime;
}
}
if (listenarrIndexer.Fields.Any(x => x.Name == "rejectBlocklistedTorrentHashesWhileGrabbing"))
{
field = listenarrIndexer.Fields.FirstOrDefault(x => x.Name == "rejectBlocklistedTorrentHashesWhileGrabbing");
if (field != null)
{
field.Value = Settings.SyncRejectBlocklistedTorrentHashesWhileGrabbing;
}
}
}
return listenarrIndexer;
}
}

View file

@ -39,9 +39,6 @@ public ListenarrSettings()
[FieldDefinition(3, Label = "Sync Categories", Type = FieldType.Select, SelectOptions = typeof(NewznabCategoryFieldConverter), HelpText = "Only Indexers that support these categories will be synced", Advanced = true)]
public IEnumerable<int> SyncCategories { get; set; }
[FieldDefinition(4, Type = FieldType.Checkbox, Label = "ApplicationSettingsSyncRejectBlocklistedTorrentHashes", HelpText = "ApplicationSettingsSyncRejectBlocklistedTorrentHashesHelpText", Advanced = true)]
public bool SyncRejectBlocklistedTorrentHashesWhileGrabbing { get; set; }
public NzbDroneValidationResult Validate()
{
return new NzbDroneValidationResult(Validator.Validate(this));

View file

@ -111,47 +111,6 @@ public List<ListenarrIndexer> GetIndexerSchema(ListenarrSettings settings)
return new List<ListenarrIndexer> { obj.ToObject<ListenarrIndexer>() };
}
if (token.Type == Newtonsoft.Json.Linq.JTokenType.Array)
{
var list = new List<ListenarrIndexer>();
foreach (var item in (Newtonsoft.Json.Linq.JArray)token)
{
if (item.Type != Newtonsoft.Json.Linq.JTokenType.Object)
{
throw new JsonReaderException("Unexpected JSON token while parsing Listenarr schema array");
}
var obj = (Newtonsoft.Json.Linq.JObject)item;
if (obj["fields"] is Newtonsoft.Json.Linq.JObject fieldsObj2)
{
var fieldsArray = new Newtonsoft.Json.Linq.JArray();
foreach (var prop in fieldsObj2.Properties())
{
if (prop.Value.Type == Newtonsoft.Json.Linq.JTokenType.Object)
{
var fieldItem = (Newtonsoft.Json.Linq.JObject)prop.Value;
fieldItem["name"] = prop.Name;
fieldsArray.Add(fieldItem);
}
else
{
var fieldItem = new Newtonsoft.Json.Linq.JObject { ["name"] = prop.Name, ["value"] = prop.Value };
fieldsArray.Add(fieldItem);
}
}
obj["fields"] = fieldsArray;
}
list.Add(obj.ToObject<ListenarrIndexer>());
}
return list;
}
throw new JsonReaderException("Unexpected JSON token while parsing Listenarr schema");
}