Compare commits

..

No commits in common. "f7e8b13faeadc731b3f39d2806002cb28bcd4674" and "ee0cd08cf37faf00b481c88d048139f6dbc63132" have entirely different histories.

5 changed files with 6 additions and 11 deletions

View file

@ -9,7 +9,7 @@ block view
.d-grid.gx8.gy12.jc-center.break-word(style="grid-template-columns: repeat(auto-fit, 210px)") .d-grid.gx8.gy12.jc-center.break-word(style="grid-template-columns: repeat(auto-fit, 210px)")
each item in items each item in items
div div
a.cover(href=item.item_url hx-get=`/api/play/${item.item_type}/${item.item_id}` hx-target="#player" hx-select="#player" hx-indicator="null" hx-push-url="false") a.cover(href=`/api/play/${item.item_type}/${item.item_id}` hx-target="#player" hx-select="#player" hx-indicator="null" hx-push-url="false")
picture picture
img(loading="lazy" src=item.item_art_url width=210 height=210) img(loading="lazy" src=item.item_art_url width=210 height=210)
!= icons.use("play-solid", 64) != icons.use("play-solid", 64)

View file

@ -28,5 +28,5 @@ block view
span.s-tag--sponsor!= icons.use("flower", 16) span.s-tag--sponsor!= icons.use("flower", 16)
= label = label
each preview in item.previews each preview in item.previews
a.d-flex(href=preview.item_url hx-get=`/api/play/${preview.item_type}/${preview.item_id}` hx-target="#player" hx-select="#player" hx-indicator="null" hx-push-url="false") a.d-flex(href=`/api/play/${preview.item_type}/${preview.item_id}` hx-target="#player" hx-select="#player" hx-indicator="null" hx-push-url="false")
img(loading="lazy" src=preview.item_art_url width=210 height=210 style="height: auto; width: auto; max-height: 70px") img(loading="lazy" src=preview.item_art_url width=210 height=210 style="height: auto; width: auto; max-height: 70px")

View file

@ -28,5 +28,5 @@ block view
span.s-tag--sponsor!= icons.use("compact-disc", 16) span.s-tag--sponsor!= icons.use("compact-disc", 16)
= item.total_duration = item.total_duration
each preview in item.previews each preview in item.previews
a.d-flex(href=preview.item_url hx-get=`/api/play/${preview.item_type}/${preview.item_id}` hx-target="#player" hx-select="#player" hx-indicator="null" hx-push-url="false") a.d-flex(href=`/api/play/${preview.item_type}/${preview.item_id}` hx-target="#player" hx-select="#player" hx-indicator="null" hx-push-url="false")
img(loading="lazy" src=preview.item_art_url width=210 height=210 style="height: auto; width: auto; max-height: 70px") img(loading="lazy" src=preview.item_art_url width=210 height=210 style="height: auto; width: auto; max-height: 70px")

View file

@ -1,10 +1,5 @@
#player #player
.s-sidebarwidget(style="overflow: hidden") .s-sidebarwidget(style="overflow: hidden")
div(style="margin: -1px; margin-bottom: -11px").ps-relative div(style="margin: -1px; margin-bottom: -11px").ps-relative
button.ps-absolute.bg-white.bar0.t0.r0.s-btn.s-btn__icon.s-btn__muted.s-btn__sm.px12(hx-get=`/api/play/${item_type}/${item_id}` hx-target="#player" hx-select="#player" hx-push-url="false" title="reload embedded player").fc-theme-primary!= icons.get("refresh-double", 18) a.ps-absolute.bg-white.bar0.t0.r0.s-btn.s-btn__icon.s-btn__muted.s-btn__sm.px12(href=`/api/play/${item_type}/${item_id}` hx-target="#player" hx-select="#player" hx-push-url="false" title="reload embedded player").fc-theme-primary!= icons.get("refresh-double", 18)
iframe#player-iframe(style="border: 0; width: 100%; height: 424px;" data-src=`https://bandcamp.com/EmbeddedPlayer/track=${track_id}/size=large/bgcol=ffffff/linkcol=63b2cc/artwork=none/transparent=true/${item_type}=${item_id}`) iframe(style="border: 0; width: 100%; height: 424px;" src=`https://bandcamp.com/EmbeddedPlayer/${item_type}=${item_id}/size=large/bgcol=ffffff/linkcol=63b2cc/artwork=none/transparent=true/track=${track_id}`)
script.
var dark = window.matchMedia?.("(prefers-color-scheme: dark)").matches
var iframe = document.getElementById("player-iframe")
if (dark) iframe.src = iframe.getAttribute("data-src").replace("bgcol=ffffff", "bgcol=000000")
else iframe.src = iframe.getAttribute("data-src")

View file

@ -36,7 +36,7 @@ const sqls = {
function loadPreviews(locals, field, number, whereClause, account, filter_field, filter, filter_fuzzy) { function loadPreviews(locals, field, number, whereClause, account, filter_field, filter, filter_fuzzy) {
const params = [account, number] const params = [account, number]
let sql = `SELECT ${field}, item_id, item_type, item_url, item_art_url FROM (SELECT ${field}, item_id, item_type, item_url, item_art_url, row_number() OVER (PARTITION BY ${field} ORDER BY purchased DESC) AS row_number FROM item {JOIN TAG} WHERE account = ? {WHERE}) WHERE row_number <= ?` let sql = `SELECT ${field}, item_id, item_type, item_art_url FROM (SELECT ${field}, item_id, item_type, item_art_url, row_number() OVER (PARTITION BY ${field} ORDER BY purchased DESC) AS row_number FROM item {JOIN TAG} WHERE account = ? {WHERE}) WHERE row_number <= ?`
sql = sql.replace("{WHERE}", whereClause) sql = sql.replace("{WHERE}", whereClause)
if (whereClause) { if (whereClause) {
if (filter_field === "band_url" || filter_fuzzy) { if (filter_field === "band_url" || filter_fuzzy) {