fix: report progress.
This commit is contained in:
parent
889df318db
commit
3c3ddc9e83
1 changed files with 3 additions and 0 deletions
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue