mirror of
https://github.com/heyarne/airsonic-ui.git
synced 2026-05-07 02:33:39 +02:00
Move artists into library (#68)
* Use more sensible naming for api responses * Move artist overview into library; closes #50 and #52 * Fix sass live-reload * Move editor config out of shadow-cljs.edn
This commit is contained in:
parent
14914e9915
commit
930bf55390
13 changed files with 82 additions and 47 deletions
|
|
@ -55,7 +55,8 @@
|
|||
(->>
|
||||
[[[::routes/library {:kind "recent"}] "Recently played"]
|
||||
[[::routes/library {:kind "newest"}] "Newest additions"]
|
||||
[[::routes/library {:kind "starred"}] "Starred"]]
|
||||
[[::routes/library {:kind "starred"}] "Starred"]
|
||||
[[::routes/artist.overview] "Artists"]]
|
||||
(map (fn [[[id params :as route] label]]
|
||||
(cond-> {:href (apply routes/url-for route)
|
||||
:label label}
|
||||
|
|
@ -63,12 +64,17 @@
|
|||
(= (:kind params) (:kind current-params)))
|
||||
(assoc :active? true))))))
|
||||
|
||||
(defn tab-section [current-route]
|
||||
[:section.section.ui-tab-bar.is-small>div.container
|
||||
[tabs {:items (tab-items current-route)}]])
|
||||
|
||||
(defn main
|
||||
"Renders the pagination and shows a list of all albums with their cover art.
|
||||
The first parameter is the route that's passed in, the second one is the
|
||||
content that has been fetched for that route."
|
||||
[[_ {:keys [kind]} {:keys [page] :or {page 1}} :as current-route]
|
||||
{:keys [scan-status]}]
|
||||
(println "scan-status" scan-status)
|
||||
(let [library @(subscribe [:library/paginated kind])
|
||||
page (int page)
|
||||
current-items (get library page)
|
||||
|
|
@ -77,14 +83,13 @@
|
|||
:items library
|
||||
:url-fn url-fn}]]
|
||||
[:div
|
||||
[:section.hero.is-small>div.hero-body>div.container
|
||||
[tab-section current-route]
|
||||
[:section.hero.single-line.is-small>div.hero-body>div.container
|
||||
[:h2.title "Your library"]
|
||||
(if (:count scan-status)
|
||||
[:p.subtitle.is-5.has-text-grey [:strong (:count scan-status)] " items"]
|
||||
(when (:scanning scan-status)
|
||||
[:p.subtitle.is-5.has-text-grey "Scanning…"]))]
|
||||
[:section.section.is-small>div.container
|
||||
[tabs {:items (tab-items current-route)}]]
|
||||
[:section.section.is-tiny>div.container pagination-links]
|
||||
[:section.section.is-tiny>div.container [collection/listing current-items]]
|
||||
[:section.section.is-tiny>div.container pagination-links]]))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue