From 5bfc883de9cde10a7cfa6e5670068e86eafb0232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arne=20Schl=C3=BCter?= Date: Wed, 22 Aug 2018 18:16:38 +0200 Subject: [PATCH] Fix artist and album views --- src/cljs/airsonic_ui/routes.cljs | 4 +++- src/cljs/airsonic_ui/views.cljs | 17 +++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/cljs/airsonic_ui/routes.cljs b/src/cljs/airsonic_ui/routes.cljs index e0c0801..a92c404 100644 --- a/src/cljs/airsonic_ui/routes.cljs +++ b/src/cljs/airsonic_ui/routes.cljs @@ -34,7 +34,9 @@ (defmethod -route-events ::artist-view [route-id params query] - [:api/request "getArtist" (select-keys params [:id])]) + (let [params (select-keys params [:id])] + [[:api/request "getArtist" params] + [:api/request "getArtistInfo2" params]])) (defmethod -route-events ::album-view [route-id params query] diff --git a/src/cljs/airsonic_ui/views.cljs b/src/cljs/airsonic_ui/views.cljs index ef28732..8f89a67 100644 --- a/src/cljs/airsonic_ui/views.cljs +++ b/src/cljs/airsonic_ui/views.cljs @@ -13,20 +13,21 @@ ;; TODO: Find better names and places for these. -(defn album-detail [content] +(defn album-detail [{:keys [album]}] [:div - [:h2.title (str (:artist content) " - " (:name content))] - [song/listing (:song content)]]) + [:h2.title (str (:artist album) " - " (:name album))] + [song/listing (:song album)]]) -(defn artist-detail [content] +(defn artist-detail [{:keys [artist artist-info]}] [:div - [:h2.title (:name content)] - [album/listing (:album content)]]) + [:h2.title (:name artist)] + [:div.content>p {:dangerouslySetInnerHTML {:__html (:biography artist-info)}}] + [album/listing (:album artist)]]) -(defn most-recent [content] +(defn most-recent [{:keys [album-list]}] [:div [:h2.title "Recently played"] - [album/listing (get-in content [:album-list :album])]]) + [album/listing (:album album-list)]]) (defn sidebar [user] [:aside.menu.section