fix: fix server mode crop application, request rewrite, and prevent infinite library scan loop
Build and Release Plugin / release (push) Failing after 1m7s
Build and Release Plugin / release (push) Failing after 1m7s
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user