Changeset 13b2986 in Klonkt for src/routes/epk.js


Ignore:
Timestamp:
06/19/2026 08:20:35 AM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
977f65d
Parents:
59e522f
Message:

EPK: Music section = top 10 most played (instead of first 6 in order)

Query now orders by play_count DESC LIMIT 10; section is titled "Most played"
with a rank number per track.

Co-Authored-By: Claude <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/routes/epk.js

    r59e522f r13b2986  
    2525  if (!site) return next();
    2626
     27  // Top 10 meest beluisterde nummers (op play_count), niet zomaar de eerste paar.
    2728  const tracks = db.prepare(
    28     `SELECT title, artist, duration, cover_url
     29    `SELECT title, artist, duration, cover_url, COALESCE(play_count, 0) AS plays
    2930       FROM audio_tracks
    3031      WHERE site_id = ?
    31       ORDER BY position ASC, created_at ASC
    32       LIMIT 6`
     32      ORDER BY plays DESC, position ASC, created_at ASC
     33      LIMIT 10`
    3334  ).all(site.id);
    3435
Note: See TracChangeset for help on using the changeset viewer.