From 3c3ddc9e834cafb1bb22fe1365f09bf867515732 Mon Sep 17 00:00:00 2001 From: redxef Date: Thu, 7 Nov 2024 22:32:11 +0100 Subject: [PATCH] fix: report progress. --- .../ScheduledTasks/GeneratePlaylist.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Jellyfin.Plugin.SmartPlaylist/ScheduledTasks/GeneratePlaylist.cs b/Jellyfin.Plugin.SmartPlaylist/ScheduledTasks/GeneratePlaylist.cs index 1df6f71..0c4fed3 100644 --- a/Jellyfin.Plugin.SmartPlaylist/ScheduledTasks/GeneratePlaylist.cs +++ b/Jellyfin.Plugin.SmartPlaylist/ScheduledTasks/GeneratePlaylist.cs @@ -145,6 +145,7 @@ namespace Jellyfin.Plugin.SmartPlaylist.ScheduledTasks { _store.DeleteSmartPlaylist(dto); // delete in case the file was not the canonical one. await _store.SaveSmartPlaylistAsync(dto); } + var i = 0; foreach (SmartPlaylistLinkDto playlistLink in dto.Playlists) { User? user = _userManager.GetUserById(playlistLink.UserId); if (user == null) { @@ -154,6 +155,8 @@ namespace Jellyfin.Plugin.SmartPlaylist.ScheduledTasks { var playlist = _playlistManager.GetPlaylists(playlistLink.UserId).Where(x => x.Id == playlistLink.PlaylistId).First(); await ClearPlaylist(playlist); await _playlistManager.AddItemToPlaylistAsync(playlist.Id, insertItems, playlistLink.UserId); + i += 1; + progress.Report(((double)i)/dto.Playlists.Count()); } } }