[Fix] - Command remove with -1 as argument

This commit is contained in:
Rafael Vargas 2022-01-14 19:51:24 -04:00
parent c23d4c13cb
commit cbd8ed45f9

View File

@ -175,7 +175,10 @@ class Playlist(IPlaylist):
return config.ERROR_MOVING
def remove_song(self, position) -> str:
if position not in range(1, len(self.__queue) + 1) and position != -1:
if position == -1:
position = len(self.__queue)
if position not in range(1, len(self.__queue) + 1):
return config.LENGTH_ERROR
else:
song = self.__queue[position-1]