diff --git a/configuration.default.ini b/configuration.default.ini index 2f8a4e9..be14edc 100644 --- a/configuration.default.ini +++ b/configuration.default.ini @@ -199,8 +199,8 @@ help =

Commands

  • !stop - stop playing
  • !skip - jump to the next song
  • !volume {volume} - get or change the volume (from 0 to 100)
  • -
  • !mode [{mode}] - get or set the playback mode, {mode} should be one of one-shot (play the playlist - once), repeat (looping through the playlist), random (randomize the playlist)
  • +
  • !mode [{mode}] - get or set the playback mode, {mode} should be one of one-shot (remove + item once played), repeat (looping through the playlist), random (randomize the playlist)
  • !duck on/off - enable or disable ducking function
  • !duckv - set the volume of the bot when ducking is activated
  • !duckthres - set the threshold of volume to activate ducking (3000 by default)
  • diff --git a/configuration.example.ini b/configuration.example.ini index d6dba7c..3379a3b 100644 --- a/configuration.example.ini +++ b/configuration.example.ini @@ -29,7 +29,7 @@ port = 64738 #volume = 0.1 # 'playback_mode' defined the playback mode of the bot. -# it should be one of "one-shot" (play the playlist once), "repeat" (looping through the playlist), +# it should be one of "one-shot" (remove item once played), "repeat" (looping through the playlist), # or "random" (randomize the playlist). # This option will be overridden by value in the database. #playback_mode = one-shot diff --git a/media/playlist.py b/media/playlist.py index b636642..caf931b 100644 --- a/media/playlist.py +++ b/media/playlist.py @@ -59,7 +59,11 @@ class PlayList(list): logging.debug("playlist: Next into the queue") if self.current_index < len(self) - 1: - self.current_index += 1 + if self.mode == "one-shot": + super().__delitem__(self.current_index) + else: + self.current_index += 1 + return self[self.current_index] else: self.current_index = 0