Adding Reset and Shuffle Controller and some fix

This commit is contained in:
Rafael Vargas
2022-03-25 14:31:37 -04:00
parent d30ff93dc1
commit 8ac80c216f
9 changed files with 128 additions and 191 deletions

View File

@@ -13,23 +13,22 @@ class QueueController(AbstractController):
async def run(self) -> ControllerResponse:
if self.player.playlist.looping_one:
info = self.player.playlist.current
embed = self.embeds.ONE_SONG_LOOPING(info)
song = self.player.playlist.current
embed = self.embeds.ONE_SONG_LOOPING(song.info)
return ControllerResponse(self.ctx, embed)
songs_preload = self.player.playlist.songs_to_preload
if len(songs_preload) == 0:
embed = self.embeds.EMPTY_QUEUE
embed = self.embeds.EMPTY_QUEUE()
return ControllerResponse(self.ctx, embed)
await self.__down.preload(songs_preload)
if self.player.playlist.looping_all:
title = self.__config.ALL_SONGS_LOOPING
title = self.config.ALL_SONGS_LOOPING
else:
title = self.__config.QUEUE_TITLE
title = self.config.QUEUE_TITLE
title = self.config.QUEUE_TITLE
total_time = format_time(sum([int(song.duration if song.duration else 0)
for song in songs_preload]))
total_songs = len(self.player.playlist)