From 4da8d9e0d60311db440657f417be0ee1f2cd7c94 Mon Sep 17 00:00:00 2001 From: Elijah Lopez Date: Tue, 24 Dec 2024 15:47:18 -0500 Subject: [PATCH] support system audio in REST API --- CHANGELOG.txt | 3 +++ src/meta.py | 2 +- src/music_caster.py | 9 ++++++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index f40a0d7..694265c 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -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 diff --git a/src/meta.py b/src/meta.py index 8bb6cf4..5099246 100644 --- a/src/meta.py +++ b/src/meta.py @@ -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 diff --git a/src/music_caster.py b/src/music_caster.py index a47ee0b..7ad7fb1 100644 --- a/src/music_caster.py +++ b/src/music_caster.py @@ -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()