Show what a feed says it is on its page in the Directory (#130)
A feed's page in the Directory (#128) had its cover, category and latest items, but not the feed's own description, which Apple's show page leads with: iPX read every item's description and threw the channel's away, and the feeds table had nowhere to keep it. It is parsed now, RSS's <description>, or iTunes' summary when that is empty, or Atom's subtitle, kept in feeds.description (kept when a later read has none, as title and image are), and sent, sanitized, with the items from /api/directory/{id}, which is now an object, not a list. The page shows it as plain text under the header, three lines of it, with More when there is more. A description that only repeats the title is left out. feeds.description is the first column added to a table that already exists. create_missing looks for it with a SELECT and runs the ALTER only when it is missing, since it runs on every open, the healthcheck's included, and an ALTER's lock is what made that time out before. The same once-only step forgets every feed's ETag and Last-Modified: a feed is read whole only when it has changed, so its description would otherwise wait for its next item. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -910,6 +910,9 @@ test('the Directory lists what everyone here reads, the most subscribed first, b
|
||||
await tiles.filter({ hasText: 'Test Show' }).locator('.txt').click();
|
||||
await expect(piper.locator('.show h2')).toHaveText('Test Show');
|
||||
await expect(piper.locator('#dshow .lep', { hasText: 'First Episode' })).toBeVisible();
|
||||
// What the feed says it is, from its own <description> (#130).
|
||||
await expect(piper.locator('#dabout p')).toHaveText('A fixture feed.');
|
||||
await expect(piper.locator('#dabout button')).toBeHidden();
|
||||
// Back, onto the tile it was opened from, the page under it as it was.
|
||||
await piper.locator('#directory .dback').click();
|
||||
await expect(tiles.filter({ hasText: 'Test Show' })).toBeFocused();
|
||||
@@ -917,6 +920,7 @@ test('the Directory lists what everyone here reads, the most subscribed first, b
|
||||
// Only a listed feed has one, and it carries no file or its address.
|
||||
const preview = await (await piper.request.get('/api/directory/test-show')).text();
|
||||
expect(preview).toContain('First Episode');
|
||||
expect(JSON.parse(preview).description).toBe('A fixture feed.');
|
||||
expect(preview).not.toContain('.mp3');
|
||||
expect((await piper.request.get('/api/directory/paid-show')).status()).toBe(404);
|
||||
// Nor does anything else give a feed's items or files to someone who does not subscribe (#129).
|
||||
|
||||
Reference in New Issue
Block a user