feat: change volume from string to integer type
Parser: - Change volume type from Option<String> to Option<i32> - Parse volume as integer to remove leading zeros - Keep original title with volume info Indexer: - Update SQL queries to insert volume as integer - Add volume column to INSERT and UPDATE statements API: - Change BookItem.volume and BookDetails.volume to Option<i32> - Add natural sorting for books Backoffice: - Update volume type to number - Update book detail page - Add CSS styles
This commit is contained in:
@@ -68,6 +68,13 @@ export default async function BookDetailPage({
|
||||
<span className={`book-kind ${book.kind}`}>{book.kind.toUpperCase()}</span>
|
||||
</div>
|
||||
|
||||
{book.volume && (
|
||||
<div className="meta-row">
|
||||
<span className="meta-label">Volume:</span>
|
||||
<span>{book.volume}</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{book.language && (
|
||||
<div className="meta-row">
|
||||
<span className="meta-label">Language:</span>
|
||||
@@ -87,10 +94,50 @@ export default async function BookDetailPage({
|
||||
<span>{library?.name || book.library_id}</span>
|
||||
</div>
|
||||
|
||||
{book.series && (
|
||||
<div className="meta-row">
|
||||
<span className="meta-label">Series:</span>
|
||||
<span>{book.series}</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{book.file_format && (
|
||||
<div className="meta-row">
|
||||
<span className="meta-label">File Format:</span>
|
||||
<span>{book.file_format.toUpperCase()}</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{book.file_parse_status && (
|
||||
<div className="meta-row">
|
||||
<span className="meta-label">Parse Status:</span>
|
||||
<span className={`status-${book.file_parse_status}`}>{book.file_parse_status}</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{book.file_path && (
|
||||
<div className="meta-row">
|
||||
<span className="meta-label">File Path:</span>
|
||||
<code className="file-path">{book.file_path}</code>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="meta-row">
|
||||
<span className="meta-label">ID:</span>
|
||||
<span className="meta-label">Book ID:</span>
|
||||
<code className="book-id">{book.id}</code>
|
||||
</div>
|
||||
|
||||
<div className="meta-row">
|
||||
<span className="meta-label">Library ID:</span>
|
||||
<code className="book-id">{book.library_id}</code>
|
||||
</div>
|
||||
|
||||
{book.updated_at && (
|
||||
<div className="meta-row">
|
||||
<span className="meta-label">Updated:</span>
|
||||
<span>{new Date(book.updated_at).toLocaleString()}</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -36,6 +36,9 @@ export default async function BooksPage({
|
||||
volume: hit.volume,
|
||||
language: hit.language,
|
||||
page_count: null,
|
||||
file_path: null,
|
||||
file_format: null,
|
||||
file_parse_status: null,
|
||||
updated_at: ""
|
||||
}));
|
||||
totalHits = searchResponse.estimated_total_hits;
|
||||
|
||||
@@ -706,3 +706,26 @@ button:hover {
|
||||
.dark .series-cover {
|
||||
background: linear-gradient(135deg, hsl(221 24% 20%), hsl(221 24% 15%));
|
||||
}
|
||||
|
||||
/* Status badges */
|
||||
.status-ok {
|
||||
color: hsl(142 60% 45%);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.status-error {
|
||||
color: hsl(2 72% 48%);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.status-pending {
|
||||
color: hsl(45 93% 47%);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.file-path {
|
||||
font-size: 0.8rem;
|
||||
word-break: break-all;
|
||||
max-width: 400px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
@@ -37,9 +37,12 @@ export type BookDto = {
|
||||
title: string;
|
||||
author: string | null;
|
||||
series: string | null;
|
||||
volume: string | null;
|
||||
volume: number | null;
|
||||
language: string | null;
|
||||
page_count: number | null;
|
||||
file_path: string | null;
|
||||
file_format: string | null;
|
||||
file_parse_status: string | null;
|
||||
updated_at: string;
|
||||
};
|
||||
|
||||
@@ -54,7 +57,7 @@ export type SearchHitDto = {
|
||||
title: string;
|
||||
author: string | null;
|
||||
series: string | null;
|
||||
volume: string | null;
|
||||
volume: number | null;
|
||||
kind: string;
|
||||
language: string | null;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user