Skip to content

Commit

Permalink
support system audio in REST API
Browse files Browse the repository at this point in the history
  • Loading branch information
elibroftw committed Dec 24, 2024
1 parent 56cace1 commit 4da8d9e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 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
- [Feat] Support "System Audio" in REST API

5.22.2
- [Feat] Support "System Audio" in CLI

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.2'
VERSION = latest_version = '5.22.3'
UPDATE_MESSAGE = """
[NEW] Support "System Audio" in CLI
[MSG] Language translators wanted
Expand Down
9 changes: 6 additions & 3 deletions src/music_caster.py
Original file line number Diff line number Diff line change
Expand Up @@ -1046,9 +1046,12 @@ def api_play():
if not queue_only and not play_next and settings['queue_library'] and merge_plays == 0:
queue_all()
elif 'uri' in request_data:
play_uris([request_data['uri']], queue_uris=queue_only, play_next=play_next, merge_tracks=merge_plays)
if settings['queue_library']:
queue_all()
if request_data['uri'].lower().replace(' ', '').replace('_', '') == 'systemaudio':
play_system_audio()
else:
play_uris([request_data['uri']], queue_uris=queue_only, play_next=play_next, merge_tracks=merge_plays)
if settings['queue_library']:
queue_all()
else:
recent_api_plays['play'] += 1
return redirect('/') if request.method == 'GET' else api_state()
Expand Down

0 comments on commit 4da8d9e

Please sign in to comment.