2 Commits

Author SHA1 Message Date
a71ced086a Merge branch 'main' of https://git.tdpi.dev/TDPI/jellyfin-plugin-smartnotify
All checks were successful
Create Release PR / Create Release PR (push) Successful in 19s
2026-04-07 08:38:20 +02:00
85fd002f4e fix: slow start of jellyfin 2026-04-07 08:38:18 +02:00

View File

@@ -50,11 +50,7 @@ public class SmartNotifyBackgroundService : IHostedService, IDisposable
{
_logger.LogInformation("SmartNotify background service starting");
// Pre-populate DB with all existing library items so they're recognized as "known".
// This prevents mass notifications on first run or after DB reset.
SeedExistingLibraryItems();
// Subscribe to library events
// Subscribe to library events (before seeding so we don't miss items added during seed).
_libraryManager.ItemAdded += OnItemAdded;
_libraryManager.ItemRemoved += OnItemRemoved;
@@ -64,6 +60,10 @@ public class SmartNotifyBackgroundService : IHostedService, IDisposable
_processTimer.AutoReset = true;
_processTimer.Start();
// Pre-populate DB with existing library items in the background
// so we don't block Jellyfin startup.
_ = Task.Run(() => SeedExistingLibraryItems(), cancellationToken);
_logger.LogInformation("SmartNotify is now monitoring library changes");
return Task.CompletedTask;