aboutsummaryrefslogtreecommitdiff
path: root/src/frontend
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend')
-rw-r--r--src/frontend/tubo/components/audio_player.cljs14
-rw-r--r--src/frontend/tubo/events.cljs14
-rw-r--r--src/frontend/tubo/views/kiosk.cljs10
-rw-r--r--src/frontend/tubo/views/playlist.cljs11
-rw-r--r--src/frontend/tubo/views/search.cljs13
5 files changed, 33 insertions, 29 deletions
diff --git a/src/frontend/tubo/components/audio_player.cljs b/src/frontend/tubo/components/audio_player.cljs
index 6c07fe2..e8541a9 100644
--- a/src/frontend/tubo/components/audio_player.cljs
+++ b/src/frontend/tubo/components/audio_player.cljs
@@ -84,13 +84,13 @@
[uploader-name uploader-url thumbnail-url
name stream url service-color] :as current-stream}
@(rf/subscribe [:media-queue-stream])
- show-audio-player? @(rf/subscribe [:show-audio-player])
- show-media-queue? @(rf/subscribe [:show-media-queue])
- volume-level @(rf/subscribe [:volume-level])
- muted? @(rf/subscribe [:muted])
- !player @(rf/subscribe [:player])
- {:keys [current-theme]} @(rf/subscribe [:settings])
- bg-color (str "rgba(" (if (= current-theme "dark") "23, 23, 23" "255, 255, 255") ", 0.95)")]
+ show-audio-player? @(rf/subscribe [:show-audio-player])
+ show-media-queue? @(rf/subscribe [:show-media-queue])
+ volume-level @(rf/subscribe [:volume-level])
+ muted? @(rf/subscribe [:muted])
+ !player @(rf/subscribe [:player])
+ {:keys [theme]} @(rf/subscribe [:settings])
+ bg-color (str "rgba(" (if (= theme "dark") "23, 23, 23" "255, 255, 255") ", 0.95)")]
(when show-audio-player?
[:div.sticky.bottom-0.z-40.p-3.absolute.box-border.m-0
{:style
diff --git a/src/frontend/tubo/events.cljs b/src/frontend/tubo/events.cljs
index 6f77897..90282ed 100644
--- a/src/frontend/tubo/events.cljs
+++ b/src/frontend/tubo/events.cljs
@@ -324,11 +324,11 @@
(rf/reg-event-fx
::add-to-media-queue
- [(rf/inject-cofx :store)]
- (fn [{:keys [db store]} [_ stream]]
- (let [updated-db (update db :media-queue conj stream)]
- {:db updated-db
- :store (assoc store :media-queue (:media-queue updated-db))})))
+ [(rf/inject-cofx :store)]
+ (fn [{:keys [db store]} [_ stream]]
+ (let [updated-db (update db :media-queue conj stream)]
+ {:db updated-db
+ :store (assoc store :media-queue (:media-queue updated-db))})))
(rf/reg-event-fx
::change-media-queue-pos
@@ -607,8 +607,8 @@
(rf/reg-event-fx
::fetch-stream-page
(fn [{:keys [db]} [_ uri]]
- (api/get-request (str "/api/streams/" (js/encodeURIComponent uri))
- [::load-stream-page] [::bad-response])))
+ (api/get-request (str "/api/streams/" (js/encodeURIComponent uri))
+ [::load-stream-page] [::bad-response])))
(rf/reg-event-fx
::fetch-audio-player-stream
diff --git a/src/frontend/tubo/views/kiosk.cljs b/src/frontend/tubo/views/kiosk.cljs
index ed6cd09..7e534bf 100644
--- a/src/frontend/tubo/views/kiosk.cljs
+++ b/src/frontend/tubo/views/kiosk.cljs
@@ -7,12 +7,14 @@
(defn kiosk
[{{:keys [serviceId kioskId]} :query-params}]
- (let [{:keys [id url related-streams next-page]} @(rf/subscribe [:kiosk])
- next-page-url (:url next-page)
- service-color @(rf/subscribe [:service-color])
+ (let [{:keys [id url related-streams
+ next-page]} @(rf/subscribe [:kiosk])
+ next-page-url (:url next-page)
+ service-color @(rf/subscribe [:service-color])
+ service-id (or @(rf/subscribe [:service-id]) serviceId)
scrolled-to-bottom? @(rf/subscribe [:scrolled-to-bottom])]
(when scrolled-to-bottom?
- (rf/dispatch [::events/kiosk-pagination serviceId id next-page-url]))
+ (rf/dispatch [::events/kiosk-pagination service-id id next-page-url]))
[layout/content-container
[layout/content-header id]
[items/related-streams related-streams next-page-url]]))
diff --git a/src/frontend/tubo/views/playlist.cljs b/src/frontend/tubo/views/playlist.cljs
index 0f2325a..4bc7164 100644
--- a/src/frontend/tubo/views/playlist.cljs
+++ b/src/frontend/tubo/views/playlist.cljs
@@ -9,11 +9,12 @@
(defn playlist
[{{:keys [url]} :query-params}]
(let [{:keys [id name playlist-type thumbnail-url banner-url
- uploader-name uploader-url uploader-avatar stream-count
- next-page related-streams]} @(rf/subscribe [:playlist])
- next-page-url (:url next-page)
- service-color @(rf/subscribe [:service-color])
- scrolled-to-bottom? @(rf/subscribe [:scrolled-to-bottom])]
+ uploader-name uploader-url uploader-avatar
+ stream-count next-page
+ related-streams]} @(rf/subscribe [:playlist])
+ next-page-url (:url next-page)
+ service-color @(rf/subscribe [:service-color])
+ scrolled-to-bottom? @(rf/subscribe [:scrolled-to-bottom])]
(when scrolled-to-bottom?
(rf/dispatch [::events/playlist-pagination url next-page-url]))
[layout/content-container
diff --git a/src/frontend/tubo/views/search.cljs b/src/frontend/tubo/views/search.cljs
index aab6dc7..8133e03 100644
--- a/src/frontend/tubo/views/search.cljs
+++ b/src/frontend/tubo/views/search.cljs
@@ -8,12 +8,13 @@
(defn search
[{{:keys [q serviceId]} :query-params}]
- (let [{:keys [items next-page] :as search-results} @(rf/subscribe [:search-results])
- next-page-url (:url next-page)
- services @(rf/subscribe [:services])
- service-id @(rf/subscribe [:service-id])
- scrolled-to-bottom? @(rf/subscribe [:scrolled-to-bottom])]
+ (let [{:keys [items next-page]
+ :as search-results} @(rf/subscribe [:search-results])
+ next-page-url (:url next-page)
+ services @(rf/subscribe [:services])
+ service-id (or @(rf/subscribe [:service-id]) serviceId)
+ scrolled-to-bottom? @(rf/subscribe [:scrolled-to-bottom])]
(when scrolled-to-bottom?
- (rf/dispatch [::events/search-pagination q serviceId next-page-url]))
+ (rf/dispatch [::events/search-pagination q service-id next-page-url]))
[layout/content-container
[items/related-streams items next-page-url]]))