diff --git a/JellyfinPlugin/Tasks/LibraryForceRescanTask.cs b/JellyfinPlugin/Tasks/LibraryForceRescanTask.cs index 1684b31..d0aa37d 100644 --- a/JellyfinPlugin/Tasks/LibraryForceRescanTask.cs +++ b/JellyfinPlugin/Tasks/LibraryForceRescanTask.cs @@ -58,18 +58,16 @@ namespace JellyfinPlugin.Tasks { string cropData = await CropHelper.DetectCropAsync(path, config.CropDetectLimit); - if (item.ProviderIds == null) - { - item.ProviderIds = new Dictionary(); - } - - // Zawsze dodajemy flagę, nawet jak puste, żeby nie skanować drugi raz tego samego pliku - // (puste oznacza że nie ma czarnych pasów do ucięcia) - item.ProviderIds["BlackBarCrop"] = cropData ?? string.Empty; - await _libraryManager.UpdateItemAsync(item, item, ItemUpdateType.MetadataEdit, cancellationToken); - if (!string.IsNullOrEmpty(cropData)) + { + if (item.ProviderIds == null) + { + item.ProviderIds = new Dictionary(); + } + item.ProviderIds["BlackBarCrop"] = cropData; + await _libraryManager.UpdateItemAsync(item, item, ItemUpdateType.MetadataEdit, cancellationToken); _logger.LogInformation("Found black bars {Crop} in {Path}", cropData, path); + } } catch (Exception ex) {