Fix Listenarr indexer schema test and remove extra newline

Updated the ListenarrV1ProxyFixture test to use the correct JSON structure for 'fields' as an array of objects. Also removed an unnecessary newline in Listenarr.cs for code cleanliness.
This commit is contained in:
Robbie Davis 2026-01-21 15:43:33 -05:00
parent ebba206c1b
commit 28a90d27e0
2 changed files with 1 additions and 2 deletions

View file

@ -57,7 +57,7 @@ public void GetIndexerSchema_should_handle_single_object_response_with_fields_ob
{
var settings = new ListenarrSettings { BaseUrl = "http://localhost:4545", ApiKey = "abc123" };
var json = "[ { \"id\": 1, \"implementation\": \"Newznab\", \"fields\": { \"baseUrl\": { \"type\": \"text\" }, \"apiKey\": { \"type\": \"text\" } } } ]";
var json = "[ { \"id\": 1, \"implementation\": \"Newznab\", \"fields\": [ { \"name\": \"baseUrl\", \"type\": \"text\" }, { \"name\": \"apiKey\", \"type\": \"text\" } ] } ]";
Mocker.GetMock<IHttpClient>()
.Setup(c => c.Execute(It.IsAny<HttpRequest>()))

View file

@ -327,7 +327,6 @@ public override void UpdateIndexer(IndexerDefinition indexer, bool forceSync = f
if ((indexerCapabilities.MusicSearchAvailable || indexerCapabilities.SearchAvailable) &&
indexerCapabilities.Categories.SupportedCategories(Settings.SyncCategories.ToArray()).Any())
{
if (remoteIndexer.Fields != null)
{
listenarrIndexer.Fields.AddRange(remoteIndexer.Fields.Where(f => listenarrIndexer.Fields.All(s => s.Name != f.Name)));