Merge pull request 'cli: fix relative volume adjustment' (#12) from fix-new-cli-features into master

Reviewed-on: #12
This commit is contained in:
Daniel Lovbrotte Olsen 2024-06-02 02:38:17 +02:00
commit 4617f83f5c
1 changed files with 2 additions and 1 deletions

View File

@ -170,10 +170,11 @@ def set_volume(
if volume.startswith("+") or volume.startswith("-"):
current_volume = api.get_volume()
new_volume = max(0, min(100, current_volume + int(volume)))
new_volume = int(new_volume)
else:
new_volume = int(volume)
rich.print(api.set_volume(volume), file=sys.stderr)
rich.print(api.set_volume(new_volume), file=sys.stderr)
if __name__ == "__main__":