noodlemagazine fix

This commit is contained in:
Simon
2026-03-31 13:50:41 +00:00
parent bdc7d61121
commit ef459fa6b5

View File

@@ -74,10 +74,6 @@ impl NoodlemagazineProvider {
id: "month".into(), id: "month".into(),
title: "This Month".into(), title: "This Month".into(),
}, },
FilterOption {
id: "all".into(),
title: "All Time".into(),
},
], ],
multiSelect: false, multiSelect: false,
}, },
@@ -131,7 +127,9 @@ impl NoodlemagazineProvider {
match options.category.as_deref() { match options.category.as_deref() {
Some("week") => "week", Some("week") => "week",
Some("month") => "month", Some("month") => "month",
Some("all") => "all", // The upstream site does not expose a valid /popular/all route.
// Keep "all" as a backward-compatible alias for stale clients.
Some("all") => "recent",
_ => "recent", _ => "recent",
} }
} }
@@ -760,4 +758,14 @@ mod tests {
assert_eq!(NoodlemagazineProvider::resolve_sort_by("views", &options), "date"); assert_eq!(NoodlemagazineProvider::resolve_sort_by("views", &options), "date");
assert_eq!(NoodlemagazineProvider::resolve_sort_order(&options), "asc"); assert_eq!(NoodlemagazineProvider::resolve_sort_order(&options), "asc");
} }
#[test]
fn maps_legacy_all_time_period_to_recent_feed() {
let mut options = options();
options.category = Some("all".to_string());
options.sort = Some("views".to_string());
options.filter = Some("desc".to_string());
assert_eq!(NoodlemagazineProvider::resolve_popular_period(&options), "recent");
}
} }