Add e-book sidecar integration and improve request handling

Introduces optional e-book sidecar downloads from Anna's Archive, including admin UI, settings API, FlareSolverr integration, and documentation. Enhances request creation logic to prevent duplicate downloads by checking for 'downloaded' and 'available' statuses, updates UI to reflect processing state, and adds SABnzbd support to download and cleanup flows. Also updates ranking algorithm documentation and improves cache invalidation for recent requests.
This commit is contained in:
kikootwo
2026-01-07 17:19:42 -05:00
parent 24ea53bd2f
commit 95c25ff73a
26 changed files with 1968 additions and 116 deletions
+29
View File
@@ -96,3 +96,32 @@ export async function searchABSItems(libraryId: string, query: string) {
export async function triggerABSScan(libraryId: string) {
await absRequest(`/libraries/${libraryId}/scan`, { method: 'POST' });
}
/**
* Trigger metadata match for a specific library item
* This tells Audiobookshelf to automatically match and populate metadata from providers
*
* @param itemId - The Audiobookshelf item ID
* @param asin - Optional ASIN for direct Audible matching (100% accurate when provided)
*/
export async function triggerABSItemMatch(itemId: string, asin?: string) {
try {
const body: any = {
provider: 'audible', // Use Audible as the metadata provider
};
// If we have an ASIN, we can do a direct match with 100% confidence
if (asin) {
body.asin = asin;
body.overrideDefaults = true; // Override defaults since we have exact ASIN match
}
await absRequest(`/items/${itemId}/match`, {
method: 'POST',
body,
});
} catch (error) {
// Don't throw - matching is best-effort, scan should continue even if match fails
console.error(`[ABS] Failed to trigger match for item ${itemId}:`, error instanceof Error ? error.message : error);
}
}