fix: percentage base for progress was wrong.

This commit is contained in:
redxef 2024-12-22 19:45:31 +01:00
parent 5cca31cf16
commit 225dc7559f
Signed by: redxef
GPG key ID: 7DAC3AA211CBD921

View file

@ -171,7 +171,8 @@ namespace Jellyfin.Plugin.SmartPlaylist.ScheduledTasks {
_logger.LogDebug("- {0}", asm); _logger.LogDebug("- {0}", asm);
} }
var i = 0; 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) { if (!dto.Enabled) {
i += 1; i += 1;
continue; continue;
@ -211,7 +212,7 @@ namespace Jellyfin.Plugin.SmartPlaylist.ScheduledTasks {
await _playlistManager.AddItemToPlaylistAsync(playlist.Id, insertItems, playlistLink.UserId); await _playlistManager.AddItemToPlaylistAsync(playlist.Id, insertItems, playlistLink.UserId);
} }
i += 1; i += 1;
progress.Report(100 * ((double)i)/dto.Playlists.Count()); progress.Report(100 * ((double)i)/all_playlists.Count());
} }
} }