diff --git a/pug/album_grid.pug b/pug/album_grid.pug index 60e54b2..3141145 100644 --- a/pug/album_grid.pug +++ b/pug/album_grid.pug @@ -9,7 +9,7 @@ block view .d-grid.gx8.gy12.jc-center.break-word(style="grid-template-columns: repeat(auto-fit, 210px)") each item in items div - a.cover(href=`/api/play/${item.item_type}/${item.item_id}` hx-target="#player" hx-select="#player" hx-indicator="null" hx-push-url="false") + 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") picture img(loading="lazy" src=item.item_art_url width=210 height=210) != icons.use("play-solid", 64) diff --git a/pug/artist_grid.pug b/pug/artist_grid.pug index ddb1e5f..a0a73a1 100644 --- a/pug/artist_grid.pug +++ b/pug/artist_grid.pug @@ -28,5 +28,5 @@ block view span.s-tag--sponsor!= icons.use("flower", 16) = label each preview in item.previews - 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") + 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") img(loading="lazy" src=preview.item_art_url width=210 height=210 style="height: auto; width: auto; max-height: 70px") diff --git a/pug/label_grid.pug b/pug/label_grid.pug index d80db64..887dbd4 100644 --- a/pug/label_grid.pug +++ b/pug/label_grid.pug @@ -28,5 +28,5 @@ block view span.s-tag--sponsor!= icons.use("compact-disc", 16) = item.total_duration each preview in item.previews - 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") + 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") img(loading="lazy" src=preview.item_art_url width=210 height=210 style="height: auto; width: auto; max-height: 70px") diff --git a/routes/app.js b/routes/app.js index fb2caa3..f2288f8 100644 --- a/routes/app.js +++ b/routes/app.js @@ -36,7 +36,7 @@ const sqls = { function loadPreviews(locals, field, number, whereClause, account, filter_field, filter, filter_fuzzy) { const params = [account, 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 <= ?` + 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 <= ?` sql = sql.replace("{WHERE}", whereClause) if (whereClause) { if (filter_field === "band_url" || filter_fuzzy) {