feat: register ebook converter in the app so the API serves the new family
Also fixes a real bug found via the fb2 API test: file-type sniffs a real fb2 file's XML declaration as generic "xml", not "fb2" and not undetected, so it never reached the undetectable-format fallback added in the previous commit. Added an fb2->xml alias in normalizeFormat, same pattern as the existing azw3->mobi one.
This commit is contained in:
@@ -12,6 +12,7 @@ import { registerIcoConverter } from './converters/ico.js';
|
||||
import { registerHeicConverter } from './converters/heic.js';
|
||||
import { registerFontConverter } from './converters/font.js';
|
||||
import { registerDfontConverter } from './converters/dfont.js';
|
||||
import { registerEbookConverter } from './converters/ebook.js';
|
||||
import { resolveInputFormat } from './mime.js';
|
||||
import { deleteIfExists } from './storage.js';
|
||||
import { createJob, getJobByUuid } from './jobs/jobRepository.js';
|
||||
@@ -44,6 +45,7 @@ function registerAllConverters() {
|
||||
registerHeicConverter();
|
||||
registerFontConverter();
|
||||
registerDfontConverter();
|
||||
registerEbookConverter();
|
||||
convertersRegistered = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -66,6 +66,7 @@ function normalizeFormat(format) {
|
||||
if (format === 'jpg') return 'jpeg';
|
||||
if (format === 'heif') return 'heic';
|
||||
if (format === 'azw3') return 'mobi';
|
||||
if (format === 'fb2') return 'xml';
|
||||
return format;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user