Add sonarr search option (#18)

* added Sonarr search type option

* updated test data

* fixed duplicated Sonarr search items when using search type Season

* added enhanced logging option along with Sonarr and Radarr enhanced logs

* switched to ghcr.io
This commit is contained in:
Marius Nechifor
2024-12-04 22:38:32 +02:00
committed by GitHub
parent 43a11f0e4c
commit f35abdefe5
66 changed files with 554 additions and 212 deletions
@@ -1,6 +1,8 @@
using Common.Configuration;
using Common.Configuration.Arr;
using Domain.Arr.Queue;
using Domain.Enums;
using Domain.Models.Arr;
using Infrastructure.Verticals.Arr;
using Infrastructure.Verticals.DownloadClient;
using Infrastructure.Verticals.Jobs;
@@ -25,7 +27,7 @@ public sealed class QueueCleaner : GenericHandler
protected override async Task ProcessInstanceAsync(ArrInstance instance, InstanceType instanceType)
{
HashSet<int> itemsToBeRefreshed = [];
HashSet<SearchItem> itemsToBeRefreshed = [];
ArrClient arrClient = GetClient(instanceType);
await _arrArrQueueIterator.Iterate(arrClient, instance, async items =>
@@ -49,12 +51,12 @@ public sealed class QueueCleaner : GenericHandler
continue;
}
itemsToBeRefreshed.Add(GetRecordId(instanceType, record));
itemsToBeRefreshed.Add(GetRecordSearchItem(instanceType, record));
await arrClient.DeleteQueueItemAsync(instance, record);
}
});
await arrClient.RefreshItemsAsync(instance, itemsToBeRefreshed);
await arrClient.RefreshItemsAsync(instance, GetConfig(instanceType), itemsToBeRefreshed);
}
}