[FA-misc] Switches to using DTOs, updates frontend with details and reader page, updates novel import to be an upsert
This commit is contained in:
@@ -38,14 +38,8 @@
|
||||
|
||||
let { novel }: NovelCardProps = $props();
|
||||
|
||||
function pickText(novelText?: NovelNode['name'] | NovelNode['description']) {
|
||||
const texts = novelText?.texts ?? [];
|
||||
const english = texts.find((t) => t.language === 'EN');
|
||||
return (english ?? texts[0])?.text ?? 'No description available.';
|
||||
}
|
||||
|
||||
const title = $derived(pickText(novel.name));
|
||||
const descriptionRaw = $derived(pickText(novel.description));
|
||||
const title = $derived(novel.name || 'Untitled');
|
||||
const descriptionRaw = $derived(novel.description || 'No description available.');
|
||||
const descriptionHtml = $derived(sanitizeHtml(descriptionRaw));
|
||||
const coverSrc = $derived(novel.coverImage?.newPath ?? novel.coverImage?.originalPath);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user