Up Next: a queue that plays on by itself (#473)

Playing was one episode at a time: when one ended nothing followed. Up Next
is a per-account queue on the server (table `queue`, GET and PUT
/api/queue), so the phone and the browser share it. The page adds to it from
a row or the reader, reorders it by drag or arrow keys, and plays the next
when one ends; what is playing leaves it as it starts, as Overcast's does. An
episode 90% played leaves it on the server too, which covers the phone
playing on while the page is frozen.

The iOS app is told what follows (`{t:'next'}`, gated on the app saying it
can) and starts it at the end of an episode; the page takes it up through
nowPlaying as it does the car's pick. The Swift is not compiled here.

The page stub answered every unknown address with [], whose `.entries` is
Array.prototype.entries, so the queue read a function as its list; it now
answers /api/queue as an entry list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 14:31:40 +00:00
parent 2ebe77b21e
commit c65b80a06c
24 changed files with 445 additions and 41 deletions

View File

@@ -90,6 +90,12 @@ const ICON: Record<string,string>={
left:fa('0 0 512 512','<path fill="currentColor" d="M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 288 480 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-370.7 0 105.4-105.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"/>'), // solid/arrow-left
// Drawn here: Font Awesome's free set has no AirPlay. A screen with a triangle under it, as Apple's.
airplay:fa('0 0 512 512','<path fill="currentColor" d="M64 48l384 0c26.5 0 48 21.5 48 48l0 256c0 26.5-21.5 48-48 48l-56 0 0-56 48 0 0-240-368 0 0 240 48 0 0 56-56 0c-26.5 0-48-21.5-48-48L16 96c0-26.5 21.5-48 48-48zM256 288l144 176-288 0z"/>'),
// Up Next (#473): a list, with a plus to add to it or a tick once in it, the state in the
// shape. Drawn here, so the two are the same list and differ only in that mark.
queue:fa('0 0 512 512','<path fill="currentColor" d="M32 96a32 32 0 0 1 32-32h384a32 32 0 0 1 0 64H64a32 32 0 0 1-32-32zm0 160a32 32 0 0 1 32-32h384a32 32 0 0 1 0 64H64a32 32 0 0 1-32-32zm32 128h160a32 32 0 0 1 0 64H64a32 32 0 0 1 0-64zm320-64a32 32 0 0 1 32 32v48h48a32 32 0 0 1 0 64h-48v48a32 32 0 0 1-64 0v-48h-48a32 32 0 0 1 0-64h48v-48a32 32 0 0 1 32-32z"/>'),
queued:fa('0 0 512 512','<path fill="currentColor" d="M32 96a32 32 0 0 1 32-32h384a32 32 0 0 1 0 64H64a32 32 0 0 1-32-32zm0 160a32 32 0 0 1 32-32h384a32 32 0 0 1 0 64H64a32 32 0 0 1-32-32zm32 128h160a32 32 0 0 1 0 64H64a32 32 0 0 1 0-64z"/><path fill="none" stroke="currentColor" stroke-width="60" stroke-linecap="round" stroke-linejoin="round" d="M300 404l54 54 116-116"/>'),
next:fa('0 0 320 512','<path fill="currentColor" d="M52.5 440.6c-9.5 7.9-22.8 9.7-34.1 4.4S0 428.4 0 416V96c0-12.4 7.2-23.7 18.4-29s24.5-3.6 34.1 4.4l192 160L256 241V96c0-17.7 14.3-32 32-32s32 14.3 32 32v320c0 17.7-14.3 32-32 32s-32-14.3-32-32V271l-11.5 9.6-192 160z"/>'),
grip:fa('0 0 320 512','<path fill="currentColor" d="M40 352a40 40 0 1 1 0 80 40 40 0 1 1 0-80zm240 0a40 40 0 1 1 0 80 40 40 0 1 1 0-80zM40 216a40 40 0 1 1 0 80 40 40 0 1 1 0-80zm240 0a40 40 0 1 1 0 80 40 40 0 1 1 0-80zM40 80a40 40 0 1 1 0 80 40 40 0 1 1 0-80zm240 0a40 40 0 1 1 0 80 40 40 0 1 1 0-80z"/>'),
subbed:fa('0 0 512 512','<path fill="currentColor" d="M256 512a256 256 0 1 1 0-512 256 256 0 1 1 0 512zM374 145.7c-10.7-7.8-25.7-5.4-33.5 5.3L221.1 315.2 169 263.1c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l72 72c5 5 11.8 7.5 18.8 7s13.4-4.1 17.5-9.8L379.3 179.2c7.8-10.7 5.4-25.7-5.3-33.5z"/>'), // solid/circle-check
};
// What is playing, as the icon's EQ bars; the stylesheet moves them.