forked from Furumi/furumi-tui
Replace the Podcasts placeholder with subscriptions, seasons and episodes
The tab opens the FRID podcast store (podcasts.sqlite3, migrating a prototype database in place; newer or foreign files are reported and left unchanged) off the UI thread and shows subscriptions with unplayed counts and check status, podcast -> seasons -> episodes navigation, and episodes with saved position, played state, duration and date. Episode search, played filter and order run as paged store queries with request sequence numbers. Adding a feed, checking one or all feeds, marking played and unsubscribing (with a confirmation that progress is kept) go through Effect/AppEvent; a scheduler refreshes due feeds in the background. New actions are bound in the podcasts keymap context and listed in a Podcasts help section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
07dcd0587c
commit
99c4d05dec
16 files changed
+2957
-63
No files matched your search
@@ -890,6 +890,43 @@ mod tests {
|
||||
assert_eq!(KeyContext::Podcasts.label(), "podcasts");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn default_podcast_keys_resolve_only_in_the_podcasts_context() {
|
||||
let mut km = keymap_from(DEFAULT_KEYMAP);
|
||||
let shift = |c| KeyCombination::new(KeyCode::Char(c), KeyModifiers::SHIFT);
|
||||
let cases = [
|
||||
(key!(o), Action::AddPodcast),
|
||||
(key!('/'), Action::SearchEpisodes),
|
||||
(shift('R'), Action::RefreshPodcast),
|
||||
(key!(ctrl - r), Action::RefreshAllPodcasts),
|
||||
(shift('S'), Action::CycleEpisodeSort),
|
||||
(key!(f), Action::CycleEpisodeFilter),
|
||||
(key!(m), Action::ToggleEpisodePlayed),
|
||||
(shift('U'), Action::UnsubscribePodcast),
|
||||
];
|
||||
for (key, action) in cases {
|
||||
assert_eq!(
|
||||
km.resolve(key, KeyContext::Podcasts),
|
||||
KeyResolution::Action(action.clone()),
|
||||
"{action:?}"
|
||||
);
|
||||
assert_ne!(
|
||||
km.resolve(key, KeyContext::Library),
|
||||
KeyResolution::Action(action.clone()),
|
||||
"{action:?} leaks into the library"
|
||||
);
|
||||
}
|
||||
// Playback keys keep working on the Podcasts tab.
|
||||
assert_eq!(
|
||||
km.resolve(key!(space), KeyContext::Podcasts),
|
||||
KeyResolution::Action(Action::PlayPause)
|
||||
);
|
||||
assert_eq!(
|
||||
km.resolve(key!(n), KeyContext::Podcasts),
|
||||
KeyResolution::Action(Action::NextTrack)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn default_listening_history_key_resolves() {
|
||||
let mut km = keymap_from(DEFAULT_KEYMAP);
|
||||
|
||||
Reference in new issue
Block a user