diff --git a/client/src/features/auth/composables/useOidc.ts b/client/src/features/auth/composables/useOidc.ts index f2583886c..4aea292c9 100644 --- a/client/src/features/auth/composables/useOidc.ts +++ b/client/src/features/auth/composables/useOidc.ts @@ -101,7 +101,7 @@ export function useOidc() { if (!res.ok) { const err = await res.json().catch(() => ({})) - throw new Error((err as Record).message as string ?? 'OIDC login failed') + throw new Error(((err as Record).message as string) ?? 'OIDC login failed') } return res.json() diff --git a/client/src/features/book/components/BookListRow.vue b/client/src/features/book/components/BookListRow.vue index 8ce700263..86e77ccfd 100644 --- a/client/src/features/book/components/BookListRow.vue +++ b/client/src/features/book/components/BookListRow.vue @@ -42,7 +42,7 @@ const metaLine = computed(() => { return parts.length > 0 ? parts.join(' · ') : null }) -const visibleTags = computed(() => props.book.tags.slice(0, 2)) +const visibleTags = computed(() => props.book.genres.slice(0, 2)) const coverLoaded = ref(false) const coverFailed = ref(false) diff --git a/client/src/features/book/components/BookQuickView.vue b/client/src/features/book/components/BookQuickView.vue index d5d946d89..6e706886d 100644 --- a/client/src/features/book/components/BookQuickView.vue +++ b/client/src/features/book/components/BookQuickView.vue @@ -155,10 +155,10 @@ function editMetadata() { {{ detail.publisher }}

- -
- - {{ tag }} + +
+ + {{ genre }}
diff --git a/client/src/features/book/components/__tests__/DetailsTab.spec.ts b/client/src/features/book/components/__tests__/DetailsTab.spec.ts index 17e35fa0e..531dd6291 100644 --- a/client/src/features/book/components/__tests__/DetailsTab.spec.ts +++ b/client/src/features/book/components/__tests__/DetailsTab.spec.ts @@ -38,6 +38,7 @@ function makeBook(overrides: Partial = {}): BookDetail { seriesName: null, seriesIndex: null, authors: [], + genres: [], tags: [], files: [], ...overrides, diff --git a/client/src/features/book/components/detail/tabs/CoverEditorPanel.vue b/client/src/features/book/components/detail/tabs/CoverEditorPanel.vue index 4bc4c095a..861a1c48f 100644 --- a/client/src/features/book/components/detail/tabs/CoverEditorPanel.vue +++ b/client/src/features/book/components/detail/tabs/CoverEditorPanel.vue @@ -70,20 +70,14 @@ onUnmounted(() => clearTimeout(debounceTimer)) -
- - +
diff --git a/client/src/features/book/components/detail/tabs/DetailsTab.vue b/client/src/features/book/components/detail/tabs/DetailsTab.vue index 097e5c25c..fbf830194 100644 --- a/client/src/features/book/components/detail/tabs/DetailsTab.vue +++ b/client/src/features/book/components/detail/tabs/DetailsTab.vue @@ -188,10 +188,10 @@ function downloadFile() {
- -
- - {{ tag }} + +
+ + {{ genre }}
diff --git a/client/src/features/book/components/detail/tabs/EditMetadataTab.vue b/client/src/features/book/components/detail/tabs/EditMetadataTab.vue index 8631ce1d4..148e74b28 100644 --- a/client/src/features/book/components/detail/tabs/EditMetadataTab.vue +++ b/client/src/features/book/components/detail/tabs/EditMetadataTab.vue @@ -8,14 +8,14 @@ import MetadataSearchDrawer from './MetadataSearchDrawer.vue' import type { MetadataPatch } from '../../../composables/useMetadataDiff' import { useMetadataEditor } from '../../../composables/useMetadataEditor' import { useAuthorSearch } from '../../../composables/useAuthorSearch' -import { useTagSearch } from '../../../composables/useTagSearch' +import { useGenreSearch } from '../../../composables/useTagSearch' const props = defineProps<{ book: BookDetail }>() const emit = defineEmits<{ saved: [BookDetail]; coverChanged: ['extracted' | 'custom' | null] }>() const { form, saving, error, isDirty, load, reset, save } = useMetadataEditor() const { search: searchAuthors } = useAuthorSearch() -const { search: searchTags } = useTagSearch() +const { search: searchGenres } = useGenreSearch() const coverPanel = ref | null>(null) const searchOpen = ref(false) @@ -30,20 +30,29 @@ const providerIdFields = [ function setIntField(field: 'publishedYear' | 'pageCount', e: Event) { const val = (e.target as HTMLInputElement).value - if (val === '') { form[field] = null; return } + if (val === '') { + form[field] = null + return + } const n = parseInt(val, 10) form[field] = isNaN(n) ? null : n } function setFloatField(field: 'seriesIndex', e: Event) { const val = (e.target as HTMLInputElement).value - if (val === '') { form[field] = null; return } + if (val === '') { + form[field] = null + return + } const n = parseFloat(val) form[field] = isNaN(n) ? null : n } onMounted(() => load(props.book)) -watch(() => props.book.id, () => load(props.book)) +watch( + () => props.book.id, + () => load(props.book), +) async function submit() { if (coverPanel.value?.hasPending) { @@ -125,15 +134,15 @@ function handleApply({ formPatch, coverUrl }: { formPatch: MetadataPatch; coverU />
- +
- - + +
@@ -281,10 +290,5 @@ function handleApply({ formPatch, coverUrl }: { formPatch: MetadataPatch; coverU - + diff --git a/client/src/features/book/components/detail/tabs/MetadataDiffPanel.vue b/client/src/features/book/components/detail/tabs/MetadataDiffPanel.vue index 02f289321..a3d804328 100644 --- a/client/src/features/book/components/detail/tabs/MetadataDiffPanel.vue +++ b/client/src/features/book/components/detail/tabs/MetadataDiffPanel.vue @@ -19,10 +19,7 @@ const emit = defineEmits<{ const providerLabel = computed(() => getProviderLabel(props.candidate.provider, props.providers)) -const { fields, toggleField, copyAll, copyMissing, buildPatch, hasCopied } = useMetadataDiff( - props.book, - props.candidate, -) +const { fields, toggleField, copyAll, copyMissing, buildPatch, hasCopied } = useMetadataDiff(props.book, props.candidate) function apply() { emit('apply', buildPatch()) @@ -43,10 +40,7 @@ function apply() {

{{ candidate.title }}

- + {{ providerLabel }}
@@ -84,15 +78,8 @@ function apply() {
- -

- No metadata available from this source. -

+ +

No metadata available from this source.

diff --git a/client/src/features/book/components/detail/tabs/MetadataDiffRow.vue b/client/src/features/book/components/detail/tabs/MetadataDiffRow.vue index 9ddc5e82e..28a2aaf19 100644 --- a/client/src/features/book/components/detail/tabs/MetadataDiffRow.vue +++ b/client/src/features/book/components/detail/tabs/MetadataDiffRow.vue @@ -15,17 +15,19 @@ const lightboxSrc = ref(null)

{{ field.label }}

-
Preview
-
+
@@ -34,7 +36,11 @@ const lightboxSrc = ref(null)
-
+