diff options
author | Miguel Ángel Moreno <mail@migalmoreno.com> | 2024-04-29 01:35:14 +0200 |
---|---|---|
committer | Miguel Ángel Moreno <mail@migalmoreno.com> | 2024-05-29 11:16:14 +0200 |
commit | 6b00378d9d18163d0b3a7f95d44c88fa225ea752 (patch) | |
tree | 078c79616b660ea2a59965e29034cf2f4dfc5b45 /src/frontend | |
parent | ee6eda82b113a7f1759b2926aa56216411fc0461 (diff) |
feat: revert to using a stream URL for fetch-audio-player-stream
Diffstat (limited to 'src/frontend')
-rw-r--r-- | src/frontend/tubo/events.cljs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/frontend/tubo/events.cljs b/src/frontend/tubo/events.cljs index 5a8bd9a..4980ab5 100644 --- a/src/frontend/tubo/events.cljs +++ b/src/frontend/tubo/events.cljs @@ -428,7 +428,7 @@ (assoc :media-queue-pos idx) (assoc-in [:media-queue idx :stream] "")) :store (assoc store :media-queue-pos idx) - :fx [[:dispatch [::fetch-audio-player-stream stream idx true]]]})))) + :fx [[:dispatch [::fetch-audio-player-stream (:url stream) idx true]]]})))) (rf/reg-event-fx ::change-media-queue-stream @@ -465,7 +465,7 @@ :store (-> store (assoc :show-audio-player true) (assoc :media-queue (:media-queue updated-db))) - :fx [[:dispatch [::fetch-audio-player-stream stream idx (= (count (:media-queue db)) 0)]]]}))) + :fx [[:dispatch [::fetch-audio-player-stream (:url stream) idx (= (count (:media-queue db)) 0)]]]}))) (rf/reg-event-fx ::start-stream-radio @@ -481,10 +481,9 @@ (fn [{:keys [db store]} [_ streams]] {:db (assoc db :show-audio-player true) :store (assoc store :show-audio-player true) - :fx (into [] (conj - (map #(identity [:dispatch [::add-to-media-queue %]]) streams) - [:dispatch [::fetch-audio-player-stream (first streams) - (count (:media-queue db)) (= (count (:media-queue db)) 0)]]))})) + :fx (conj (map (fn [s] [:dispatch [::add-to-media-queue s]]) streams) + [:dispatch [::fetch-audio-player-stream (-> streams first :url) + (count (:media-queue db)) (= (count (:media-queue db)) 0)]])})) (rf/reg-event-db ::modal @@ -916,9 +915,9 @@ (rf/reg-event-fx ::fetch-audio-player-stream - (fn [{:keys [db]} [_ stream idx play?]] + (fn [{:keys [db]} [_ uri idx play?]] (assoc - (api/get-request (str "/streams/" (js/encodeURIComponent (:url stream))) + (api/get-request (str "/streams/" (js/encodeURIComponent uri)) [::load-audio-player-stream idx play?] [::audio-player-stream-failure play?]) :db (assoc db :show-audio-player-loading true)))) |