Directory: let an admin give a blog its category

Almost no blog names a category the Directory can use, so a feed can
carry one of its own in config.toml, set by an admin in the feed's
settings and used when the feed names none. The feed's own iTunes
category still wins. The field offers the categories the Directory
already shows, so a blog about games joins Games rather than starting a
second chip. Setting it on a feed from an OPML promotes it to config, as
any other shared setting does.

Closes #10.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-15 17:19:59 +00:00
parent 8ae5c332c3
commit b83523fc92
8 changed files with 59 additions and 7 deletions

View File

@@ -587,6 +587,7 @@ pub async fn add_one(
username: None,
password: None,
password_env: None,
category: None,
};
let title = match feed::fetch(&ctx.client, &probe, None, None).await {
@@ -713,6 +714,7 @@ pub fn subscribe_opml(
username: None,
password: None,
password_env: None,
category: None,
},
);
grew = true;
@@ -956,6 +958,7 @@ pub fn subscriptions(ctx: &Ctx) -> Result<Vec<Sub>> {
username: parent.and_then(|p| p.username.clone()),
password: parent.and_then(|p| p.password.clone()),
password_env: parent.and_then(|p| p.password_env.clone()),
category: None,
},
managed: true,
});
@@ -1658,6 +1661,7 @@ mod tests {
username: None,
password: None,
password_env: None,
category: None,
}
}