From 225dc7559fc53ff7a1c6f5caf5605ac028386a8d Mon Sep 17 00:00:00 2001 From: redxef Date: Sun, 22 Dec 2024 19:45:31 +0100 Subject: [PATCH] fix: percentage base for progress was wrong. --- .../ScheduledTasks/GeneratePlaylist.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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()); } }