]> git.0d.be Git - botaradio.git/commitdiff
refactor: changed all 'loop' into 'repeat', which is the term used in iTunes
authorTerry Geng <gengyanda@gmail.com>
Wed, 26 Feb 2020 15:37:53 +0000 (23:37 +0800)
committerTerry Geng <gengyanda@gmail.com>
Wed, 26 Feb 2020 15:37:53 +0000 (23:37 +0800)
command.py
configuration.default.ini
configuration.example.ini
interface.py
media/playlist.py
mumbleBot.py

index 00d2a4c99b08741cc89061b52313d3c3e3192868..dc716899f349b53b7d7e715814c1c37effe3d500 100644 (file)
@@ -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)
index 813c3a9a96f9adfcb5f548cfeee7b65eea04b393..2f8a4e902642005b26ada3f142c780f4b5cbd9d7 100644 (file)
@@ -200,7 +200,7 @@ help = <h3>Commands</h3>
        <li> <b>!<u>sk</u>ip </b> - jump to the next song </li>
        <li> <b>!<u>v</u>olume </b> {volume} - get or change the volume (from 0 to 100) </li>
        <li> <b>!<u>m</u>ode </b> [{mode}] - get or set the playback mode, {mode} should be one of <i>one-shot</i> (play the playlist
-       once), <i>loop</i> (looping through the playlist), <i>random</i> (randomize the playlist)</li>
+       once), <i>repeat</i> (looping through the playlist), <i>random</i> (randomize the playlist)</li>
        <li> <b>!duck </b> on/off - enable or disable ducking function </li>
        <li> <b>!duckv </b> - set the volume of the bot when ducking is activated </li>
        <li> <b>!<u>duckt</u>hres </b> - set the threshold of volume to activate ducking (3000 by default) </li>
index b592cef6d4d9f590f16ef2119ee96cc3c0bb6600..d6dba7c247ebcaf6ad35aab58e9582df98f006ef 100644 (file)
@@ -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
index d9fb77cc7702918350feaad592c856b82c7367a6..108f0b2668861337a241b5bce046857ffc2f52c1 100644 (file)
@@ -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":
index 40dfa9731b5051e6d16abcb1e17d61ffe0628d47..b636642ca54e729b9eb8e9a26be2f78583cf4792 100644 (file)
@@ -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()
index 84d46771cfcc71777339a993cad0ccbeb3728244..2418bf167dd081d90d41537242309b112c5d7720 100644 (file)
@@ -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):