Save an episode without its dead air when DeadAir is on (#186)
The save button fetched the original while the player played it shortened.
/media/{id}/deadair sends the original's ID3 tag and then the pieces of the
person's plan one after another, read as it goes: MP3 and ADTS frames each
stand alone, so that is a file any player takes, and nothing is stored, as
with the playlist. The tag stops at the first kept frame, since what can
follow it, the Xing frame, gives the original's length.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1787,6 +1787,15 @@ test('DeadAir is off until turned on for a show, then plays it shortened, with y
|
||||
await page.locator('#ssave').click();
|
||||
await expect.poll(async () => (await entry()).enclosures[0].deadair).toBeLessThan(usual);
|
||||
|
||||
// Saved without its dead air too (#186): smaller than the original, named to say so.
|
||||
const saved = await page.evaluate(async id => {
|
||||
const [d, o] = await Promise.all([fetch(`/media/${id}/deadair`), fetch(`/media/${id}`)]);
|
||||
return { status: d.status, name: d.headers.get('content-disposition'), size: (await d.arrayBuffer()).byteLength, full: (await o.arrayBuffer()).byteLength };
|
||||
}, (await entry()).enclosures[0].id);
|
||||
expect(saved.status).toBe(200);
|
||||
expect(saved.name).toContain('DeadAir');
|
||||
expect(saved.size).toBeLessThan(saved.full);
|
||||
|
||||
// Played through DeadAir's playlist (#181), by hls.js in Chromium, with the switch beside the
|
||||
// speed pressed. The element's own src is then hls.js's blob: address.
|
||||
await row.locator('[data-a=play]').click();
|
||||
|
||||
Reference in New Issue
Block a user