diff --git a/CHANGELOG.md b/CHANGELOG.md index 20b484f..24eabc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - The Directory lists feeds nobody subscribes to yet; Popular still lists what people subscribe to. - A feed nobody subscribes to is checked once a day, and at once when someone subscribes. + A feed nobody subscribes to is checked once a day, and at once when someone subscribes. A + listed feed downloads nothing until someone subscribes. - The Directory loads faster: it asked the database three questions per feed. ## [0.9.1] - 2026-09-29 diff --git a/src/main.rs b/src/main.rs index 13ff2ef..4844ea7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1725,7 +1725,10 @@ fn merge_policy(subs: &[db::Sub], feed_cfg: &config::Feed, global: usize) -> Pol if subs.is_empty() { return Policy { - auto_download: feed_cfg.auto_download, + // A feed listed in the Directory with nobody subscribed is there to be found, not + // downloaded: its files would be for no one. Once someone subscribes, the files + // skipped for it are judged again on the next scan, by their settings (#107). + auto_download: feed_cfg.auto_download && !feed_cfg.listed, allow_explicit: feed_cfg.allow_explicit, wants: vec![Want { keywords: feed_cfg.keywords.clone(), blocked: vec![] }], budget: cap(feed_cfg.max_new_per_check), @@ -1958,6 +1961,14 @@ fn duration(secs: u64) -> String { mod tests { use super::*; + #[test] + fn a_listed_feed_nobody_subscribes_to_downloads_nothing() { + let mut f = feed(); + assert!(merge_policy(&[], &f, 3).auto_download); + f.listed = true; + assert!(!merge_policy(&[], &f, 3).auto_download); + } + #[test] fn a_failing_feed_backs_off_doubling_up_to_a_day() { let hour = 3600;