Add ebook-sidecar APIs and UI integration

Introduce ebook-sidecar support: add new API routes for ebook workflows (ebook-status, fetch-ebook, interactive-search-ebook, select-ebook) that handle searching, selection, request creation, approval, and download routing (Anna's Archive direct downloads vs indexer downloads).

Update admin approval flow to understand request.type (audiobook | ebook), handle pre-selected ebook torrents (including special handling for Anna's Archive with direct download jobs and download history), and enqueue ebook-specific search/download jobs.

Frontend changes: show request type badge in admin pending approvals and augment AudiobookDetailsModal to query ebook status, start fetch/interactive ebook searches, and surface toast notifications. Also include new request lifecycle handling (retryable/active statuses, approval logic, creating audiobook records for Plex-imported books) and ranking/normalization logic for interactive ebook search results.

Other: various plumbing to integrate config checks, job queue calls, and download history storage for ebook downloads.
This commit is contained in:
kikootwo
2026-02-03 03:05:23 -05:00
parent a17473e204
commit ff07ccfdb0
10 changed files with 1858 additions and 47 deletions
+18 -3
View File
@@ -18,6 +18,7 @@ import { useState } from 'react';
interface PendingApprovalRequest {
id: string;
createdAt: string;
type: 'audiobook' | 'ebook';
audiobook: {
title: string;
author: string;
@@ -146,9 +147,23 @@ function PendingApprovalSection({ requests }: { requests: PendingApprovalRequest
{/* Book Info */}
<div className="flex-1 min-w-0">
<h3 className="text-sm font-bold text-gray-900 dark:text-gray-100 truncate">
{request.audiobook.title}
</h3>
<div className="flex items-center gap-2">
<h3 className="text-sm font-bold text-gray-900 dark:text-gray-100 truncate">
{request.audiobook.title}
</h3>
{request.type === 'ebook' && (
<span
className="inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium flex-shrink-0"
style={{
backgroundColor: 'rgba(241, 111, 25, 0.15)',
color: '#f16f19',
border: '1px solid rgba(241, 111, 25, 0.3)',
}}
>
Ebook
</span>
)}
</div>
<p className="text-sm text-gray-600 dark:text-gray-400 truncate">
{request.audiobook.author}
</p>