diff --git a/Jellyfin.Plugin.SmartPlaylist/ScheduledTasks/GeneratePlaylist.cs b/Jellyfin.Plugin.SmartPlaylist/ScheduledTasks/GeneratePlaylist.cs index d297b81..361ad4c 100644 --- a/Jellyfin.Plugin.SmartPlaylist/ScheduledTasks/GeneratePlaylist.cs +++ b/Jellyfin.Plugin.SmartPlaylist/ScheduledTasks/GeneratePlaylist.cs @@ -171,7 +171,8 @@ namespace Jellyfin.Plugin.SmartPlaylist.ScheduledTasks { _logger.LogDebug("- {0}", asm); } var i = 0; - foreach (SmartPlaylistDto dto in await _store.GetAllSmartPlaylistsAsync()) { + var all_playlists = await _store.GetAllSmartPlaylistsAsync(); + foreach (SmartPlaylistDto dto in all_playlists) { if (!dto.Enabled) { i += 1; continue; @@ -211,7 +212,7 @@ namespace Jellyfin.Plugin.SmartPlaylist.ScheduledTasks { await _playlistManager.AddItemToPlaylistAsync(playlist.Id, insertItems, playlistLink.UserId); } i += 1; - progress.Report(100 * ((double)i)/dto.Playlists.Count()); + progress.Report(100 * ((double)i)/all_playlists.Count()); } }