Skip to content

Commit

Permalink
fix: REST API
Browse files Browse the repository at this point in the history
  • Loading branch information
elibroftw committed Dec 26, 2024
1 parent 4da8d9e commit a6db80b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Music Caster Changelog

5.22.3
- [Fix] REST API

5.22.3
- [Feat] Support "System Audio" in REST API

Expand Down
2 changes: 1 addition & 1 deletion src/meta.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = latest_version = '5.22.3'
VERSION = latest_version = '5.22.4'
UPDATE_MESSAGE = """
[NEW] Support "System Audio" in CLI
[MSG] Language translators wanted
Expand Down
8 changes: 6 additions & 2 deletions src/music_caster.py
Original file line number Diff line number Diff line change
Expand Up @@ -1019,8 +1019,12 @@ def api_play():

request_data = get_request_data()
if request_data is not None:
queue_only = request_data.get('queue', '').casefold() == 'true'
play_next = request_data.get('play_next', '').casefold() == 'true'
queue_only = request_data.get('queue', False)
if isinstance(queue_only, str):
queue_only = queue_only.casefold() == 'true'
play_next = request_data.get('play_next', False)
if isinstance(play_next, str):
play_next = play_next.casefold() == 'true'
device_id = request_data.get('device', None)
if device_id is not None:
change_device(device_id)
Expand Down

0 comments on commit a6db80b

Please sign in to comment.