1
0
Fork 0
mirror of https://github.com/heyarne/airsonic-ui.git synced 2026-05-07 02:33:39 +02:00

Add library status to front page

This commit is contained in:
Arne Schlüter 2018-08-28 22:18:37 +02:00
commit 096e1b4fb8
2 changed files with 8 additions and 2 deletions

View file

@ -11,9 +11,14 @@
{:class-name "is-active"})
[:a {:href (apply url-for route)} label]]))]])
(defn main [route {:keys [album-list]}]
(defn main [route {:keys [scan-status album-list]}]
(println scan-status "status")
[:div
[:h2.title "Your library"]
(if (:count scan-status)
[:p.subtitle.is-5.has-text-grey "Containing " [:strong (:count scan-status)] " items"]
(when (:scanning scan-status)
[:p.subtitle.is-5.has-text-grey "Scanning…"]))
(let [items [[[::routes/library {:criteria "recent"} nil] "Recently played"]
[[::routes/library {:criteria "newest"} nil] "Newest additions"]
[[::routes/library {:criteria "starred"} nil] "Starred"]]]

View file

@ -33,7 +33,8 @@
(defmethod -route-events ::library
[route-id {:keys [criteria]} query]
(if criteria
[:api/request "getAlbumList2" {:type criteria, :size 18}]
[[:api/request "getScanStatus"]
[:api/request "getAlbumList2" {:type criteria, :size 20}]]
[:routes/do-navigation [route-id {:criteria "recent"} query]]))
(defmethod -route-events ::artist-view