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
@@ -271,3 +271,45 @@ command = "OpenCommandLine"
|
||||
[[keymaps]]
|
||||
key_sequence = "/"
|
||||
command = "OpenSearch"
|
||||
|
||||
# Podcasts tab. Enter opens a podcast, its seasons and episodes; Esc goes
|
||||
# back. Shift-D also unsubscribes here.
|
||||
[[keymaps]]
|
||||
key_sequence = "o"
|
||||
command = "AddPodcast"
|
||||
context = "podcasts"
|
||||
|
||||
[[keymaps]]
|
||||
key_sequence = "/"
|
||||
command = "SearchEpisodes"
|
||||
context = "podcasts"
|
||||
|
||||
[[keymaps]]
|
||||
key_sequence = "shift-r"
|
||||
command = "RefreshPodcast"
|
||||
context = "podcasts"
|
||||
|
||||
[[keymaps]]
|
||||
key_sequence = "ctrl-r"
|
||||
command = "RefreshAllPodcasts"
|
||||
context = "podcasts"
|
||||
|
||||
[[keymaps]]
|
||||
key_sequence = "shift-s"
|
||||
command = "CycleEpisodeSort"
|
||||
context = "podcasts"
|
||||
|
||||
[[keymaps]]
|
||||
key_sequence = "f"
|
||||
command = "CycleEpisodeFilter"
|
||||
context = "podcasts"
|
||||
|
||||
[[keymaps]]
|
||||
key_sequence = "m"
|
||||
command = "ToggleEpisodePlayed"
|
||||
context = "podcasts"
|
||||
|
||||
[[keymaps]]
|
||||
key_sequence = "shift-u"
|
||||
command = "UnsubscribePodcast"
|
||||
context = "podcasts"
|
||||
@@ -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