From 017cfd7e28042337cfb3556144f3679103368acb Mon Sep 17 00:00:00 2001 From: rays Date: Tue, 15 Sep 2026 16:20:49 +0000 Subject: [PATCH] Directory: file a show under its iTunes subcategory where it has one Apple puts every tabletop and gaming show under Leisure, so the top level alone put most of this server's podcasts behind one chip. Games says what they are; a show with no subcategory keeps its top-level one. Co-Authored-By: Claude Opus 5 --- CHANGELOG.md | 3 ++- src/feed.rs | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c84ade..ac04f43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,8 @@ The long form, with what was wrong before and how it was found, is in ### Added - Directory has a row of chips above it: Podcasts, Blogs, and once Podcasts is picked, each - podcast's own iTunes category. Picking one filters the Directory in place. + podcast's own iTunes category, the narrower one where a show gives two (Games, not Leisure). + Picking one filters the Directory in place. ### Changed diff --git a/src/feed.rs b/src/feed.rs index c5f7ab6..9ac5fde 100644 --- a/src/feed.rs +++ b/src/feed.rs @@ -538,10 +538,12 @@ fn from_rss(ch: rss::Channel, bytes: &[u8]) -> ParsedFeed { .map(str::to_owned) .or_else(|| ch.image().map(|i| i.url().to_owned())), // Only the iTunes one: Apple's list is fixed, while a plain is freeform and - // would fill the Directory with one-off tags. The top level only, for the same reason. + // would fill the Directory with one-off tags. The subcategory where there is one: Apple + // files every tabletop and gaming show under Leisure, which says little; Games says it. category: ch .itunes_ext() .and_then(|i| i.categories().first()) + .map(|c| c.subcategory().filter(|s| !s.text().trim().is_empty()).unwrap_or(c)) .and_then(|c| non_empty(Some(c.text().trim()))), entries, } @@ -717,7 +719,7 @@ mod tests { assert_eq!(feed.title.as_deref(), Some("Test Cast")); assert_eq!(feed.ttl_mins, Some(45)); - assert_eq!(feed.category.as_deref(), Some("Technology"), "the first, top level only"); + assert_eq!(feed.category.as_deref(), Some("Podcasting"), "the first, by its subcategory"); assert_eq!(feed.entries.len(), 3); let ep = &feed.entries[0];