A seasoned podcast runs in its own order, and a season downloads whole (#482)
Asked for on the issue: lowest to highest, by season and then episode, and a way to download every episode of a season. sort=episode orders by season, episode, then date, with the episodes in none last either way round; a podcast told in seasons opens in it until a heading is clicked, and its seasons are offered lowest first. download-latest takes a season and queues every file of it not on iPX, first episode first, up to 300; the page asks first, since a season can be gigabytes. The picked season scrolls into view in the picker, and the count under the list is the season's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RqkrVAJFkEgz9cXG3jG1Zy
This commit is contained in:
@@ -3218,20 +3218,39 @@ test('a reap over the quota says what it would delete and, dry, deletes nothing'
|
||||
expect(files()).toBe(before);
|
||||
});
|
||||
|
||||
test('a podcast told in seasons is listed one season at a time, or all with each season marked (#482)', async ({ page }) => {
|
||||
test('a podcast told in seasons runs in its own order, one season at a time or all, and a season downloads whole (#482)', async ({ page }) => {
|
||||
await page.locator('#feedlist .feed', { hasText: 'Seasoned Show' }).click({ timeout: 20_000 });
|
||||
await page.locator('#content .tabs button[data-f="all"]').click();
|
||||
const picker = page.locator('#content .seasons');
|
||||
await expect(picker.locator('button')).toHaveText(['All seasons', 'Season 2', 'Season 1', 'Other']);
|
||||
// Every season, newest first: where each starts is said above its first episode.
|
||||
await expect(page.locator('#eps .sdiv')).toHaveText(['Season 2', 'Other episodes', 'Season 1']);
|
||||
await expect(picker.locator('button')).toHaveText(['All seasons', 'Season 1', 'Season 2', 'Other']);
|
||||
// Every season, in the podcast's own order, season 1 episode 1 first: each season's start said.
|
||||
await expect(page.locator('#eps .ep .t')).toHaveText(['The Pilot', 'Season One Close', 'Season Two Opener', 'Season Two Finale', 'A Bonus Between']);
|
||||
await expect(page.locator('#eps .sdiv')).toHaveText(['Season 1', 'Season 2', 'Other episodes']);
|
||||
// A heading clicked sorts by it, newest first, as on any other podcast.
|
||||
await page.locator('.ephead [data-sort="published"]').click();
|
||||
await expect(page.locator('#eps .ep .t').first()).toHaveText('Season Two Finale');
|
||||
|
||||
await picker.locator('button', { hasText: 'Season 1' }).click();
|
||||
await expect(page.locator('#content .seasons button', { hasText: 'Season 1' })).toHaveAttribute('aria-pressed', 'true');
|
||||
await expect(page.locator('#eps .ep .t')).toHaveText(['The Pilot', 'Season One Close']);
|
||||
await expect(page.locator('#eps .sdiv')).toHaveCount(0);
|
||||
await expect(page.locator('#content .seasons button', { hasText: 'Season 1' })).toHaveAttribute('aria-pressed', 'true');
|
||||
// The count under the list is the season's, as the server counts it.
|
||||
const unread = await page.evaluate(async () => (await fetch('/api/feeds/seasoned-show/seasons').then(r => r.json()))
|
||||
.find((s: { season?: number }) => s.season === 1).unread);
|
||||
await expect(page.locator('#count')).toHaveText(`Seasoned Show: 2 items, ${unread} unread`);
|
||||
// The whole season onto iPX, after asking, its first episode first.
|
||||
await page.locator('#content .seasondl').click();
|
||||
await page.locator('#sgo').click();
|
||||
// By its words: each file's own toast follows at once on the fixtures' tiny files.
|
||||
await expect(page.locator('.toast', { hasText: /Downloading 2 episodes of Season 1|All of Season 1 is on iPX already/ })).toBeAttached();
|
||||
await expect.poll(async () => page.evaluate(async () => (await fetch('/api/feeds/seasoned-show/entries?season=1').then(r => r.json()))
|
||||
.entries.every((e: { enclosures: { path: string | null }[] }) => e.enclosures.every(x => x.path))), { timeout: 20_000 }).toBe(true);
|
||||
expect(await page.evaluate(async () => (await fetch('/api/feeds/seasoned-show/entries?season=2').then(r => r.json()))
|
||||
.entries.some((e: { enclosures: { path: string | null }[] }) => e.enclosures.some(x => x.path)))).toBe(false);
|
||||
|
||||
await page.locator('#content .seasons button', { hasText: 'Other' }).click();
|
||||
await expect(page.locator('#eps .ep .t')).toHaveText(['A Bonus Between']);
|
||||
// A podcast with one season has no picker, and opening it starts from every season again.
|
||||
// A podcast with one season has no picker, and opening it again starts from every season.
|
||||
await page.locator('#feedlist .feed', { hasText: 'Test Show' }).first().click();
|
||||
await expect(page.locator('#content .seasons')).toHaveCount(0);
|
||||
await page.locator('#feedlist .feed', { hasText: 'Seasoned Show' }).click();
|
||||
|
||||
Reference in New Issue
Block a user