diff --git a/command.py b/command.py index 00d2a4c..dc71689 100644 --- a/command.py +++ b/command.py @@ -611,7 +611,7 @@ def cmd_mode(bot, user, text, command, parameter): if not parameter: bot.send_msg(constants.strings("current_mode", mode=var.playlist.mode), text) return - if not parameter in ["one-shot", "loop", "random"]: + if not parameter in ["one-shot", "repeat", "random"]: bot.send_msg(constants.strings('unknown_mode', mode=parameter), text) else: var.db.set('playlist', 'playback_mode', parameter) diff --git a/configuration.default.ini b/configuration.default.ini index 813c3a9..2f8a4e9 100644 --- a/configuration.default.ini +++ b/configuration.default.ini @@ -200,7 +200,7 @@ help =

Commands

  • !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), loop (looping through the playlist), random (randomize the playlist)
  • + once), 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 b592cef..d6dba7c 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), "loop" (looping through the playlist), +# it should be one of "one-shot" (play the playlist once), "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/interface.py b/interface.py index d9fb77c..108f0b2 100644 --- a/interface.py +++ b/interface.py @@ -268,8 +268,8 @@ def post(): var.botamusique.resume() if action == "one-shot": var.playlist.set_mode("one-shot") - if action == "loop": - var.playlist.set_mode("loop") + if action == "repeat": + var.playlist.set_mode("repeat") elif action == "stop": var.botamusique.stop() elif action == "pause": diff --git a/media/playlist.py b/media/playlist.py index 40dfa97..b636642 100644 --- a/media/playlist.py +++ b/media/playlist.py @@ -8,13 +8,13 @@ import logging class PlayList(list): current_index = -1 version = 0 # increase by one after each change - mode = "one-shot" # "loop", "random" + mode = "one-shot" # "repeat", "random" def __init__(self, *args): super().__init__(*args) def set_mode(self, mode): - # modes are "one-shot", "loop", "random" + # modes are "one-shot", "repeat", "random" self.mode = mode if mode == "random": self.randomize() @@ -66,7 +66,7 @@ class PlayList(list): if self.mode == "one-shot": self.clear() return False - elif self.mode == "loop": + elif self.mode == "repeat": return self[0] elif self.mode == "random": self.randomize() diff --git a/mumbleBot.py b/mumbleBot.py index 84d4677..2418bf1 100644 --- a/mumbleBot.py +++ b/mumbleBot.py @@ -758,7 +758,7 @@ if __name__ == '__main__': else: playback_mode = var.config.get('bot', 'playback_mode', fallback="one-shot") - if playback_mode in ["one-shot", "loop", "random"]: + if playback_mode in ["one-shot", "repeat", "random"]: var.playlist.set_mode(playback_mode) if var.config.getboolean('bot', 'save_playlist', fallback=True):