A listed feed nobody subscribes to downloads nothing (#107)
With no subscribers a feed falls back to its own settings, where auto_download is on, so a listed feed with audio would have downloaded files for no one. The seeded news feeds carry only images, which media_types already skips, so nothing was downloaded. Files skipped for it are judged again, by the new subscriber's settings, on the next scan after someone subscribes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
13
src/main.rs
13
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;
|
||||
|
||||
Reference in New Issue
Block a user