Skip to content

Commit 1d0faba

Browse files
committed
fix quality selection original crashing
1 parent 2b94b01 commit 1d0faba

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

lib/windows/settings.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,24 @@ class ListSetting(BasicSetting):
5252
type = 'LIST'
5353
options = ()
5454

55+
@property
56+
def optionsAmount(self):
57+
return self.getOptionsAmount()
58+
59+
def getOptionsAmount(self):
60+
return len(self.options)
61+
5562
def translate(self, val):
56-
return self.options[len(self.options) - val]
63+
return self.options[self.optionsAmount - val]
5764

5865
def optionLabels(self):
5966
return self.options
6067

6168
def optionIndex(self):
62-
return len(self.options) - self.get()
69+
return self.optionsAmount - self.get()
6370

6471
def set(self, val):
65-
BasicSetting.set(self, len(self.options) - val)
72+
BasicSetting.set(self, self.optionsAmount - val)
6673

6774

6875
class QualitySetting(ListSetting):
@@ -83,6 +90,9 @@ class QualitySetting(ListSetting):
8390
T(32014),
8491
)
8592

93+
def getOptionsAmount(self):
94+
return 13
95+
8696

8797
class ThemeMusicSetting(ListSetting):
8898
options = [

0 commit comments

Comments
 (0)