Display library name in metadata viewer page (#1211)

This commit is contained in:
Aditya Chandel
2025-09-25 21:05:43 -06:00
committed by GitHub
parent f82b22145c
commit bec721c21c
5 changed files with 15 additions and 10 deletions
@@ -22,6 +22,7 @@ import java.util.stream.Collectors;
public interface BookMapper {
@Mapping(source = "library.id", target = "libraryId")
@Mapping(source = "library.name", target = "libraryName")
@Mapping(source = "libraryPath", target = "libraryPath", qualifiedByName = "mapLibraryPathIdOnly")
@Mapping(source = "metadata", target = "metadata")
@Mapping(source = "shelves", target = "shelves")
@@ -30,6 +31,7 @@ public interface BookMapper {
Book toBook(BookEntity bookEntity);
@Mapping(source = "library.id", target = "libraryId")
@Mapping(source = "library.name", target = "libraryName")
@Mapping(source = "libraryPath", target = "libraryPath", qualifiedByName = "mapLibraryPathIdOnly")
@Mapping(source = "metadata", target = "metadata")
@Mapping(source = "shelves", target = "shelves")
@@ -37,14 +39,6 @@ public interface BookMapper {
@Mapping(source = "additionalFiles", target = "supplementaryFiles", qualifiedByName = "mapSupplementaryFiles")
Book toBookWithDescription(BookEntity bookEntity, @Context boolean includeDescription);
@Mapping(source = "library.id", target = "libraryId")
@Mapping(source = "libraryPath", target = "libraryPath", qualifiedByName = "mapLibraryPathIdOnly")
@Mapping(target = "metadata", ignore = true)
@Mapping(target = "shelves", ignore = true)
@Mapping(target = "alternativeFormats", ignore = true)
@Mapping(target = "supplementaryFiles", ignore = true)
Book toBookWithoutMetadataAndShelves(BookEntity bookEntity);
default Set<String> mapAuthors(Set<AuthorEntity> authors) {
if (authors == null) return null;
return authors.stream()
@@ -16,6 +16,7 @@ import java.util.stream.Collectors;
public interface BookMapperV2 {
@Mapping(source = "library.id", target = "libraryId")
@Mapping(source = "library.name", target = "libraryName")
@Mapping(source = "libraryPath", target = "libraryPath", qualifiedByName = "mapLibraryPathIdOnly")
@Mapping(target = "metadata", qualifiedByName = "mapMetadata")
Book toDTO(BookEntity bookEntity);
@@ -17,6 +17,7 @@ public class Book {
private Long id;
private BookFileType bookType;
private Long libraryId;
private String libraryName;
private String fileName;
private String filePath;
private String fileSubPath;
@@ -28,6 +28,7 @@ export interface Book extends FileInfo {
id: number;
bookType: BookType;
libraryId: number;
libraryName: string;
metadata?: BookMetadata;
shelves?: Shelf[];
lastReadTime?: string;
@@ -69,7 +69,9 @@
<div class="flex flex-col items-center md:items-start gap-1">
<div class="flex items-center gap-2 justify-center md:justify-start flex-wrap text-center md:text-left">
<h2 class="text-2xl md:text-3xl font-extrabold leading-tight">
{{ book?.metadata?.title }}@if (book?.metadata?.subtitle) {: {{ book.metadata?.subtitle }}}
{{ book?.metadata?.title }}@if (book?.metadata?.subtitle) {
: {{ book.metadata?.subtitle }}
}
</h2>
<i
class="pi align-middle"
@@ -229,6 +231,12 @@
<div class="px-1 md:px-0">
<div class="grid md:grid-cols-4 gap-y-2.5 text-sm pt-2 md:pt-4 pb-2 text-gray-300 md:min-w-[60rem] md:max-w-[100rem]">
<p class="whitespace-nowrap max-w-[250px] overflow-hidden text-ellipsis">
<span class="font-bold">Library: </span>
@if (book?.libraryName) {
<span>{{ book.libraryName }}</span>
}
</p>
<p class="whitespace-nowrap max-w-[250px] overflow-hidden text-ellipsis">
<span class="font-bold">Publisher: </span>
@if (book?.metadata?.publisher) {
@@ -241,7 +249,6 @@
</p>
<p><strong>Published:</strong> {{ book?.metadata!.publishedDate || '-' }}</p>
<p><strong>Language:</strong> {{ book?.metadata!.language || '-' }}</p>
<p><strong>File Size:</strong> {{ getFileSizeInMB(book) }}</p>
<p class="whitespace-nowrap flex items-center gap-2">
<span class="font-bold">File Type:</span>
<span
@@ -378,6 +385,7 @@
</div>
}
<p><strong>Page Count:</strong> {{ book?.metadata!.pageCount || '-' }}</p>
<p><strong>File Size:</strong> {{ getFileSizeInMB(book) }}</p>
</div>
<div class="flex items-center gap-2">