Now Playing lists an episode's chapters, and a tap plays from there (#477)
Where they come from, in order: the chapters file an item names
(<podcast:chapters url>, the Podcasting 2.0 namespace's JSON), stored on
the item as entries.chapters and read when someone opens Now Playing; else
the downloaded file's own chapters (ID3 CHAP frames, MP4 chapters), which
ffprobe reads as it does for DeadAir. A chapter with toc false is only
there to change the artwork and is left out.
GET /api/enclosures/{id}/chapters answers for a file, since a file is what
plays. With ?deadair=true the starts are moved into DeadAir's shortened
clock with to_copy, as positions are, or a chapter would start late by
every silence cut before it. A chapters file that cannot be read is an
empty list: the player plays on without them, and the step's span says why.
Items already stored get their chapters address when a scan next finds
them told differently; feeds that answer 304 add it with their next items.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RqkrVBuJRne2JAhFpaDV2U
This commit is contained in:
@@ -493,6 +493,13 @@ test('Now Playing opens from the player bar with the artwork, show notes and Up
|
||||
await expect(sheet.locator('h2')).toHaveText('Second Episode');
|
||||
await expect(sheet.locator('.dbody')).toContainText('Notes for the second.');
|
||||
await expect(sheet.locator('#nowqueue .childrow')).toHaveText([/First Episode/]);
|
||||
// Its chapters, from the file its item names, in order; a tap plays from there (#477).
|
||||
const chapters = sheet.locator('.chapters button');
|
||||
await expect(chapters).toHaveText([/0:00\s*Opening/, /0:01\s*The middle/]);
|
||||
await chapters.nth(1).click();
|
||||
await expect.poll(() => page.evaluate(() => audio.currentTime)).toBeGreaterThanOrEqual(1.4);
|
||||
await expect(chapters.nth(1)).toHaveAttribute('aria-current', 'true');
|
||||
await expect(chapters.nth(0)).not.toHaveAttribute('aria-current');
|
||||
await page.keyboard.press('Escape');
|
||||
await expect(sheet).toBeHidden();
|
||||
// From the keyboard too, and the podcast's name opens its feed.
|
||||
|
||||
@@ -124,6 +124,10 @@ http.createServer((req, res) => {
|
||||
// Where /flip.xml moves to for good.
|
||||
'/moved.xml': ['application/rss+xml', `<?xml version="1.0"?><rss version="2.0"><channel><title>Flip Show</title>
|
||||
<item><guid>flip-1</guid><title>Flip one</title></item></channel></rss>`],
|
||||
// Second Episode's chapters (#477): one only for its artwork, which is not listed.
|
||||
'/chapters.json': ['application/json+chapters', JSON.stringify({ version: '1.2.0', chapters: [
|
||||
{ startTime: 1.5, title: 'The middle' }, { startTime: 0, title: 'Opening' }, { startTime: 1, img: `${at}/art.jpg`, toc: false },
|
||||
] })],
|
||||
'/said.txt': ['text/plain', 'Unable to establish a DB connection'],
|
||||
'/long.txt': ['text/plain', 'This site is down for maintenance and will be back shortly, thank you for your patience while we work'],
|
||||
'/empty.xml': ['application/xml', ''],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0"?>
|
||||
<rss version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
|
||||
<rss version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:podcast="https://podcastindex.org/namespace/1.0">
|
||||
<channel><title>Test Show</title><link>http://127.0.0.1:8792/</link><description>A fixture feed.</description>
|
||||
<itunes:image href="http://127.0.0.1:8792/art.png"/>
|
||||
<itunes:category text="Technology"/>
|
||||
@@ -12,5 +12,6 @@
|
||||
<pubDate>Mon, 08 Sep 2026 10:00:00 +0000</pubDate>
|
||||
<description>Notes for the second.</description>
|
||||
<itunes:duration>900</itunes:duration>
|
||||
<podcast:chapters url="http://127.0.0.1:8792/chapters.json" type="application/json+chapters"/>
|
||||
<enclosure url="http://127.0.0.1:8792/ep1.mp3?2" length="40000" type="audio/mpeg"/></item>
|
||||
</channel></rss>
|
||||
Reference in New Issue
Block a user