gitoria

jukebox

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit0f2157a90f2157a9jukebox JV1: onto Hybriel set-day27b: readBytes and stat for /stream and the mp3 tags (no dd, head or tail), startup fault exits 1, fs and mpackdb plugins re-vendored; songs with a comma in the title are indexed againmre0f2157a9/lib/api-helpers.hl

943 B

  1. // lib/api-helpers.hl — the plumbing of the function routes (lib/api.hl): JSON answers, query numbers.
  2. import { Response } from 'hl:http1'
  3. import { leadingInt } from './util.hl'
  4. static jsonHeaders = { 'Content-Type' = 'application/json; charset=utf-8' 'X-Content-Type-Options' = 'nosniff' 'Cache-Control' = 'no-store' }
  5. static reply = (status, value) => {
  6. return new Response(JSON.stringify(value), { status = status headers = jsonHeaders })
  7. }
  8. static fail = (status, message) => { return reply(status, { error = message }) }
  9. // a query value as a non-negative whole Number, or null (missing or not a number)
  10. static queryNumber = (req, name) => {
  11. v = req.query == null ? null : req.query[name]
  12. if (v == null || hlTypeName(v) != 'String') { return null }
  13. return leadingInt(v)
  14. }
  15. static queryText = (req, name) => {
  16. v = req.query == null ? null : req.query[name]
  17. return v == null || hlTypeName(v) != 'String' || v == '' ? null : v
  18. }

Branches

Latest commits

  • 0f2157a9jukebox JV1: onto Hybriel set-day27b: readBytes and stat for /stream and the mp3 tags (no dd, head or tail), startup fault exits 1, fs and mpackdb plugins re-vendored; songs with a comma in the title are indexed againmre
  • 63d0f2eejukebox ST1 (jukebox#2): styles of main, songs and search moved into their own Style blocks (styles.hl 81 to 8 rules, pixel-identical at 390 and 1280); artist and album wait for an hl:web fixmre
  • c5b8fde9jukebox JB3b: keyboard gap repro as a reportmre
  • 9daebb4bjukebox JB3b: shuffle, now-playing overlay, next and previous, play counting, media session, gates; keyboard left open (Hybriel gap)mre
  • 59c1373ejukebox JB3 (work in progress): albums without folder and with disc markers folded, compilations, duplicate songs, own play counter, server-side shuffle queuemre
  • 2a4cfc55jukebox: library screens (songs, artists, albums, artist, album, search, favourites), compact player bar, /stream with Range, thumbnails, virtual list vendored, ui gate and real-library checkmre
  • 93a44212jukebox: report, numbers of the full scan, notes on the index key rulemre
  • bf5167dajukebox: index keys without commas (mpackdb loses them after a reopen), comma fixture and gate checksmre
  • 28a82fa2jukebox: README, STATUS, LOG, DECISIONSmre
  • d13987dfjukebox: library scanner, ID3 reader, mpackdb database and JSON API, with fixtures and a gatemre