jukebox
All repositories: gitoria
1.4 KB
// components/album.hl — `/albums/<id>`: one album, the cover large on top, its songs in track order below; a tap plays from that song on.parent './main.hl'import VirtualList from './virtual-list/virtual-list.hl'import { rowsFor, albumInfo } from '../lib/rows.hl'id = nullinfo = albumInfo(id)__title = info.name + ' · Jukebox'Hybrid albumCtx = { kind = 'album' album = id }Hybrid firstRows = rowsFor({ kind = 'album' album = id }, 0, 100)Number listTotal = firstRows.totalHybrid chunk = firstRows.rowsNumber chunkFrom = 0String playingId = ''Boolean hasCover = info.img != ''Boolean noCover = info.img == ""String coverAlt = "Cover of " + info.nameon albumLoad(first, wanted) {let start = first - 20if (start < 0) { start = 0 }r = emit server jbRows(albumCtx, start, 100)listTotal = r.totalchunk = r.rowschunkFrom = r.offsetreturn null}loadRange = (first, wanted) => { emit albumLoad(first, wanted) }picked = (rowId, index) => {playingId = rowIdemit jbPlay(albumCtx, index)}View {jbScreen {VirtualList { itemCount = listTotal rowHeight = 56 loaded = chunk loadedFrom = chunkFrom onRange = loadRange onPick = picked selectedId = playingId thumbs = "false" listLabel = "Songs of the album"jbHead { class = "jb-album"if (hasCover) { img { id = "cover" src = info.img alt = coverAlt } }if (noCover) { div { class = "jb-nocover" 'aria-hidden' = "true" } }h1 { id = "name" info.name }p { info.artist }p { info.line }}}}}
Branches
Latest commits
- 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