Changed some layouts of the view and fixed a bug

This commit is contained in:
Choco
2024-02-21 10:43:15 +08:00
parent cc7b868a53
commit f2da4311f5
2 changed files with 6 additions and 6 deletions

View File

@@ -78,8 +78,8 @@ class ListView(discord.ui.View):
embed = discord.Embed(title=texts[0], color=func.settings.embed_color)
embed.description=texts[1].format(self.player.current.uri, f"```{self.player.current.title}```") if self.player.current else texts[2].format("None")
embed.description += "\n" + (texts[4] if self.is_queue else texts[5]) + "\n" + "\n".join([
f"{track.emoji} `{i:>2}.` `[" + (texts[3] if track.is_stream else func.time(track.length)) + f'`] **[{func.truncate_string(track.title)}]({track.uri})** ' + (track.requester.mention)
embed.description += "\n**" + (texts[4] if self.is_queue else texts[5]) + "**\n" + "\n".join([
f"{track.emoji} `{i:>2}.` `[" + (texts[3] if track.is_stream else func.time(track.length)) + f']` [{func.truncate_string(track.title)}]({track.uri})' + (track.requester.mention)
for i, track in enumerate(tracks, start=offset-6)
])
embed.set_footer(text=texts[6].format(self.current_page, self.page, self.time))

View File

@@ -102,16 +102,16 @@ class PlaylistView(discord.ui.View):
else:
embed.description += texts[2] + "\n" + texts[4].format(', '.join(f'<@{user}>' for user in perms['read']))
embed.description += f"\n\n**{texts[5]}:**\n"
if tracks:
if self.current.get("type") == "playlist":
embed.description += texts[5] + "\n" + "\n".join(f"{func.get_source(track['sourceName'], 'emoji')} `{index:>2}.` `[{func.time(track['length'])}]` **[{func.truncate_string(track.title)}]({track.uri})**" for index, track in enumerate(tracks, start=offset - 6))
embed.description += "\n".join(f"{func.get_source(track['sourceName'], 'emoji')} `{index:>2}.` `[{func.time(track['length'])}]` [{func.truncate_string(track['title'])}]({track['uri']})" for index, track in enumerate(tracks, start=offset - 6))
else:
embed.description += texts[5] + "\n" + '\n'.join(f"{func.get_source(extract(track.info['uri']).domain, 'emoji')} `{index:>2}.` `[{func.time(track.length)}]` **[{func.truncate_string(track.title)}]({track.uri})** " for index, track in enumerate(tracks, start=offset - 6))
embed.description += '\n'.join(f"{func.get_source(extract(track.info['uri']).domain, 'emoji')} `{index:>2}.` `[{func.time(track.length)}]` [{func.truncate_string(track.title)}]({track.uri})" for index, track in enumerate(tracks, start=offset - 6))
else:
embed.description += texts[5] + "\n" + texts[6].format(self.current['name'])
embed.description += texts[6].format(self.current['name'])
embed.set_footer(text=texts[7].format(self.current_page, self.page, self.current['time']))
return embed
async def on_timeout(self) -> None: