File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
DotNetTwitchBot/Bot/Commands/Music Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -206,7 +206,7 @@ private void UpdateUnplayedSongs()
206206 {
207207 var songList = BackupPlaylist . Songs . ToList ( ) ;
208208 songList . Shuffle ( ) ;
209-
209+ UnplayedSongs . Clear ( ) ;
210210 foreach ( var nextSong in songList )
211211 {
212212 UnplayedSongs . Enqueue ( nextSong ) ;
@@ -603,6 +603,7 @@ public async Task LoadPlayList(int id)
603603 db . Settings . Update ( lastPlaylist ) ;
604604 await db . SaveChangesAsync ( ) ;
605605 }
606+ UpdateUnplayedSongs ( ) ;
606607 await _hubContext . Clients . All . SendAsync ( "UpdateCurrentPlaylist" , BackupPlaylist ) ;
607608 }
608609
@@ -644,6 +645,9 @@ private async Task ImportPlaylist(CommandEventArgs e)
644645 } ;
645646 }
646647
648+ var totalSongs = songLinks . Length ;
649+ var importedSongs = 0 ;
650+
647651 foreach ( var songLink in songLinks )
648652 {
649653 var song = await GetSongByLinkOrId ( songLink ) ;
@@ -656,6 +660,8 @@ private async Task ImportPlaylist(CommandEventArgs e)
656660 continue ;
657661 }
658662 song . RequestedBy = ServiceBackbone . BotName ?? "TheBot" ;
663+ importedSongs ++ ;
664+ _logger . LogInformation ( "Imported {importedSongs}/{totalSongs} songs" , importedSongs , totalSongs ) ;
659665 playList . Songs . Add ( song ) ;
660666 }
661667
You can’t perform that action at this time.
0 commit comments