mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-06-03 12:50:09 +00:00
Add series fields to audiobooks and update related logic
Introduces 'series' and 'seriesPart' fields to the Audiobook model and database schema. Updates API routes, file organization, and path template utilities to support series metadata. Enhances chapter merging logic, improves notification backend testing, and expands test coverage for admin and API routes.
This commit is contained in:
@@ -45,7 +45,10 @@ export function RequestActionsDropdown({
|
||||
const canSearch = ['pending', 'failed', 'awaiting_search'].includes(request.status);
|
||||
const canCancel = ['pending', 'searching', 'downloading'].includes(request.status);
|
||||
const canDelete = true; // Admins can always delete
|
||||
const canViewSource = !!request.torrentUrl && ['downloading', 'processing', 'downloaded', 'available'].includes(request.status);
|
||||
// Only show "View Source" if we have a valid indexer page URL (not a magnet link)
|
||||
const canViewSource = !!request.torrentUrl &&
|
||||
!request.torrentUrl.startsWith('magnet:') &&
|
||||
['downloading', 'processing', 'downloaded', 'available'].includes(request.status);
|
||||
const canFetchEbook = ebookSidecarEnabled && ['downloaded', 'available'].includes(request.status);
|
||||
|
||||
// Close dropdown when clicking outside
|
||||
|
||||
@@ -117,12 +117,15 @@ export function NotificationsTab() {
|
||||
setIsTesting(true);
|
||||
setTestResult(null);
|
||||
|
||||
// In edit mode, use backend ID to test with real config (masked values won't work)
|
||||
// In add mode, use the form config directly
|
||||
const testPayload = modalState.mode === 'edit' && modalState.backend
|
||||
? { backendId: modalState.backend.id }
|
||||
: { type: modalState.selectedType, config: formData.config };
|
||||
|
||||
const response = await fetchWithAuth('/api/admin/notifications/test', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({
|
||||
type: modalState.selectedType,
|
||||
config: formData.config,
|
||||
}),
|
||||
body: JSON.stringify(testPayload),
|
||||
});
|
||||
|
||||
const data = await response.json();
|
||||
|
||||
@@ -137,6 +137,14 @@ export function PathsTab({ paths, onChange, onValidationChange }: PathsTabProps)
|
||||
<code className="text-blue-700 dark:text-blue-300 font-mono">{'{asin}'}</code>
|
||||
<span className="text-gray-600 dark:text-gray-400 ml-2">- Audible ASIN</span>
|
||||
</div>
|
||||
<div>
|
||||
<code className="text-blue-700 dark:text-blue-300 font-mono">{'{series}'}</code>
|
||||
<span className="text-gray-600 dark:text-gray-400 ml-2">- Book series name</span>
|
||||
</div>
|
||||
<div>
|
||||
<code className="text-blue-700 dark:text-blue-300 font-mono">{'{seriesPart}'}</code>
|
||||
<span className="text-gray-600 dark:text-gray-400 ml-2">- Series part/position</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user