Bibliothek: Gruppieren nach Autor / Serie / Genre (Gruppen-Überschriften mit Zähler; Serie über Bulk-API mit 24-h-Cache)

This commit is contained in:
2026-11-07 17:37:33 +01:00
parent 441a55dcdf
commit e23958bd50
6 changed files with 201 additions and 6 deletions

View File

@ -7,6 +7,8 @@ use audible::{AudibleClient, AuthStatus, Book, CliAudibleClient};
use download::{DownloadMgr, SharedDownloadMgr};
use player::{MpvPlayer, Player, PlayerState, SharedPlayer};
use std::collections::BTreeMap;
use tauri::Manager;
use tauri::menu::{Menu, MenuItem};
use tauri::tray::TrayIconBuilder;
@ -166,6 +168,14 @@ async fn player_stop(pl: tauri::State<'_, SharedPlayer>) -> Result<PlayerState,
.map_err(|e| format!("Hintergrundthread fehlgeschlagen: {e}"))?
}
/// Serien-Bulk (24 h-Cache) für die Bibliotheksgruppierung.
#[tauri::command]
async fn book_series_bulk(refresh: bool) -> Result<BTreeMap<String, audible::SerieRef>, String> {
tauri::async_runtime::spawn_blocking(move || audible::series_bulk(refresh))
.await
.map_err(|e| format!("Hintergrundthread fehlgeschlagen: {e}"))?
}
/// Einzeldetails (Beschreibung u. a.) per Audible-API, on demand.
#[tauri::command]
async fn book_details(asin: String) -> Result<audible::BookExtra, String> {
@ -291,6 +301,7 @@ pub fn run() {
start_decrypt,
get_library,
get_local_books,
book_series_bulk,
book_details,
stream_only,
get_alter_notes,