fix: fix server mode crop application, request rewrite, and prevent infinite library scan loop
Build and Release Plugin / release (push) Failing after 1m7s

This commit is contained in:
2026-09-17 20:51:54 +02:00
parent 648930aa21
commit 322cfd9acd
3 changed files with 87 additions and 126 deletions
+14
View File
@@ -23,6 +23,8 @@ namespace JellyfinPlugin
private readonly ILogger<LibraryMonitor> _logger;
private readonly SemaphoreSlim _ffmpegSemaphore = new SemaphoreSlim(2, 2);
private readonly ConcurrentDictionary<Guid, byte> _processedItems = new ConcurrentDictionary<Guid, byte>();
public LibraryMonitor(ILibraryManager libraryManager, ILogger<LibraryMonitor> logger)
{
_libraryManager = libraryManager;
@@ -48,6 +50,16 @@ namespace JellyfinPlugin
{
if (!Plugin.Instance!.Configuration.IsEnabled) return;
if (_processedItems.ContainsKey(video.Id)) return;
if (video.ProviderIds != null &&
video.ProviderIds.TryGetValue("BlackBarCrop", out string? existingCrop) &&
!string.IsNullOrEmpty(existingCrop))
{
_processedItems.TryAdd(video.Id, 0);
return;
}
// Fire and forget, don't block library scan
_ = Task.Run(() => ProcessVideoAsync(video));
}
@@ -57,6 +69,8 @@ namespace JellyfinPlugin
{
try
{
if (!_processedItems.TryAdd(video.Id, 0)) return;
if (video.ProviderIds != null &&
video.ProviderIds.TryGetValue("BlackBarCrop", out string? existingCrop) &&
!string.IsNullOrEmpty(existingCrop))