mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
[Audio] Don't allow duplicate links in playlists (#2071)
* Just a test * another test * undoing my test * First solution, style issue * Works functionally, but there are is a minor style issue * style fixed * Revert README changes
This commit is contained in:
parent
9ee860c3f0
commit
a2fe1a8757
@ -713,6 +713,11 @@ class Audio:
|
||||
if not to_append:
|
||||
return
|
||||
track_list = playlists[playlist_name]["tracks"]
|
||||
if track_list and len(to_append) == 1 and to_append[0] in track_list:
|
||||
return await self._embed_msg(
|
||||
ctx,
|
||||
"{} already in {}.".format(to_append[0]["info"]["title"], playlist_name),
|
||||
)
|
||||
if track_list:
|
||||
playlists[playlist_name]["tracks"] = track_list + to_append
|
||||
else:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user