Compare commits

..

2 Commits

Author SHA1 Message Date
974c671012 docs: add r toggle 2026-01-05 22:46:10 +01:00
0cf9884c6c feat: add a refresh toggle 2026-01-05 22:46:05 +01:00
2 changed files with 14 additions and 1 deletions

View File

@@ -40,6 +40,7 @@ Please also note that as of now, you need to have [ffmpeg](https://ffmpeg.org/)
| `down` | Decrease playback speed | | `down` | Decrease playback speed |
| `f` | Mark as finished | | `f` | Mark as finished |
| `d` | Download/delete from cache | | `d` | Download/delete from cache |
| `r` | Refresh view |
| `s` | Show stats screen | | `s` | Show stats screen |
| `/` | Filter library | | `/` | Filter library |
| `q` | Quit the application | | `q` | Quit the application |

View File

@@ -47,6 +47,7 @@ class Auditui(App):
("n", "sort", "Sort by name"), ("n", "sort", "Sort by name"),
("p", "sort_by_progress", "Sort by progress"), ("p", "sort_by_progress", "Sort by progress"),
("a", "show_all", "All/Unfinished"), ("a", "show_all", "All/Unfinished"),
("r", "refresh", "Refresh"),
("enter", "play_selected", "Play"), ("enter", "play_selected", "Play"),
("space", "toggle_playback", "Pause/Resume"), ("space", "toggle_playback", "Pause/Resume"),
("left", "seek_backward", "-30s"), ("left", "seek_backward", "-30s"),
@@ -227,7 +228,10 @@ class Auditui(App):
self._search_text_cache.clear() self._search_text_cache.clear()
self._prime_search_cache(items) self._prime_search_cache(items)
self.update_status(f"Loaded {len(items)} books") self.update_status(f"Loaded {len(items)} books")
self.show_unfinished() if self.show_all_mode:
self.show_all()
else:
self.show_unfinished()
def on_library_error(self, error: str) -> None: def on_library_error(self, error: str) -> None:
"""Handle library fetch error.""" """Handle library fetch error."""
@@ -295,6 +299,14 @@ class Auditui(App):
else: else:
self.show_all() self.show_all()
def action_refresh(self) -> None:
"""Refresh the library data from the API."""
if not self.client:
self.update_status("Not authenticated. Cannot refresh.")
return
self.update_status("Refreshing library...")
self.fetch_library()
def action_play_selected(self) -> None: def action_play_selected(self) -> None:
"""Start playing the selected book.""" """Start playing the selected book."""
if not self.download_manager: if not self.download_manager: