refactor: changed all 'loop' into 'repeat', which is the term used in iTunes

This commit is contained in:
Terry Geng
2020-02-26 23:37:53 +08:00
parent 76547886d1
commit a46a1d7073
6 changed files with 9 additions and 9 deletions

View 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()