Queue for tag downloads

This commit is contained in:
Cadence Ember 2025-04-09 20:46:01 +12:00
parent be489e9a18
commit 5e9ea6db66
6 changed files with 58 additions and 8 deletions

View file

@ -6,6 +6,7 @@ html
title BC Explorer
link(rel="icon" href="/favicon.png")
link(rel="stylesheet" type="text/css" href="/static/stacks.css")
link(rel="stylesheet" type="text/css" href="/static/style.css")
script(src="/static/htmx.js")
meta(name="htmx-config" content='{"requestClass":"is-loading"}')
body.themed.theme-system.overflow-y-scroll
@ -30,3 +31,17 @@ html
input.s-input.wmx3#username(name="account" placeholder="Enter your Bandcamp username here")
button.s-btn.s-btn__filled.my16#submit-username Load collection
#results.d-flex
.s-prose.mt32
main
h2 About BC Explorer
p Explore your Bandcamp collection online!
p You can easily search your whole collection and play it streaming rather than downloading every mp3 to your computer and using a media player.
aside: p.fs-fine (you should download every mp3, though, because the Bandcamp TOS says they can take away your online access at any time)
footer.mt32.d-flex.fw-wrap.gx8.ai-center
a(href="https://cadence.moe") Created by Cadence
.s-award-bling.s-award-bling__silver.ml4
a(href="https://gitdab.com/cadence/bc-explorer") BC Explorer source code
.s-award-bling.s-award-bling__silver.ml4
span Not affiliated with Bandcamp.

View file

@ -1,6 +1,15 @@
if downloader.total > 0 || downloader.outcome
#tag-download
if !downloader.running && !downloader.outcome
if downloader.queuePosition > 0
.s-notice.p16(role="status" hx-target="#tag-download" hx-select="#tag-download" hx-get=`/api/tag-download?account=${account}` hx-trigger="every 30s" hx-indicator="null")
.d-flex.gx16.ai-center
!= icons.get("cloud-download")
.fl-grow1 Waiting to download...
p.mt12.mb0 #{downloader.queuePosition} people are ahead of you in the queue.
p.mt12.mb0 You can keep using BC Explorer and this will process in the background.
title#title(hx-swap-oob="true") In queue | Tags | BC Explorer
else if !downloader.running && !downloader.outcome
form.s-notice.s-notice__info.d-flex.ai-center.p8.gx16.pl16(role="status" hx-target="#tag-download" hx-select="#tag-download" hx-post="/api/tag-download")
!= icons.get("info-circle")
div Tag data needs to be downloaded. This will take a while.
@ -28,7 +37,7 @@ if downloader.total > 0 || downloader.outcome
!= icons.get("cloud-check")
.fl-grow1 Tags downloaded.
- downloader.resolve()
a.s-btn.s-btn__outlined(href=and({arrange: "tag"}) hx-boost="true") Refresh
a.s-btn.s-btn__outlined(href=and({arrange: "tag", shape: "grid"})) Refresh
else
.s-notice.s-notice__danger.p8.gx16.pl16.d-flex.ai-center