audio: Use the new match / case statement in scale.py:format_value()

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
Anna Schumaker 2021-12-28 17:24:09 -05:00
parent 0c7a4a4a4c
commit f9cec5e1b3
1 changed files with 5 additions and 5 deletions

View File

@ -72,11 +72,11 @@ class AutoPauseScale(ScalePlus):
return self.get_value() == 0
def format_value(self, scale, value):
value = int(value)
if value == -1: return "Keep Playing"
elif value == 0: return "This Track"
elif value == 1: return "Next Track"
return f"{value} Tracks"
match int(value):
case -1: return "Keep Playing"
case 0: return "This Track"
case 1: return "Next Track"
case _: return f"{int(value)} Tracks"
def decrement(self):
self.keep_playing = not self.about_to_pause()