mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-10-02 00:34:37 +02:00
Fixed: (LazyLibrarian) Sync priority
This commit is contained in:
@@ -147,6 +147,7 @@ namespace NzbDrone.Core.Applications.LazyLibrarian
|
||||
Categories = string.Join(",", indexer.Capabilities.Categories.SupportedCategories(Settings.SyncCategories.ToArray())),
|
||||
Enabled = indexer.Enable,
|
||||
Type = schema,
|
||||
Priority = indexer.Priority
|
||||
};
|
||||
|
||||
return lazyLibrarianIndexer;
|
||||
|
@@ -30,6 +30,7 @@ namespace NzbDrone.Core.Applications.LazyLibrarian
|
||||
public bool Enabled { get; set; }
|
||||
public string Altername { get; set; }
|
||||
public LazyLibrarianProviderType Type { get; set; }
|
||||
public int Priority { get; set; }
|
||||
|
||||
public bool Equals(LazyLibrarianIndexer other)
|
||||
{
|
||||
@@ -43,7 +44,8 @@ namespace NzbDrone.Core.Applications.LazyLibrarian
|
||||
other.Name == Name &&
|
||||
other.Categories == Categories &&
|
||||
other.Enabled == Enabled &&
|
||||
other.Altername == Altername;
|
||||
other.Altername == Altername &&
|
||||
other.Priority == Priority;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -21,6 +21,8 @@ namespace NzbDrone.Core.Applications.LazyLibrarian
|
||||
|
||||
public class LazyLibrarianV1Proxy : ILazyLibrarianV1Proxy
|
||||
{
|
||||
private const int ProwlarrHighestPriority = 50;
|
||||
|
||||
private readonly IHttpClient _httpClient;
|
||||
private readonly Logger _logger;
|
||||
|
||||
@@ -90,7 +92,8 @@ namespace NzbDrone.Core.Applications.LazyLibrarian
|
||||
{ "host", indexer.Host },
|
||||
{ "prov_apikey", indexer.Apikey },
|
||||
{ "enabled", indexer.Enabled.ToString().ToLower() },
|
||||
{ "categories", indexer.Categories }
|
||||
{ "categories", indexer.Categories },
|
||||
{ "dlpriority", CalculatePriority(indexer.Priority).ToString() }
|
||||
};
|
||||
|
||||
var request = BuildRequest(settings, "/api", "addProvider", HttpMethod.Get, parameters);
|
||||
@@ -108,7 +111,8 @@ namespace NzbDrone.Core.Applications.LazyLibrarian
|
||||
{ "prov_apikey", indexer.Apikey },
|
||||
{ "enabled", indexer.Enabled.ToString().ToLower() },
|
||||
{ "categories", indexer.Categories },
|
||||
{ "altername", indexer.Altername }
|
||||
{ "altername", indexer.Altername },
|
||||
{ "dlpriority", CalculatePriority(indexer.Priority).ToString() }
|
||||
};
|
||||
|
||||
var request = BuildRequest(settings, "/api", "changeProvider", HttpMethod.Get, parameters);
|
||||
@@ -191,5 +195,7 @@ namespace NzbDrone.Core.Applications.LazyLibrarian
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
private int CalculatePriority(int indexerPriority) => ProwlarrHighestPriority - indexerPriority + 1;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user