Display the file size in the book metadata details section
* Display the file size in the Book Metadata details section - Implement AppMigration feature - Populate missing file sizes for books with null file size in 'populateFileSizes' migration --------- Co-authored-by: adityachandelgit
This commit is contained in:
co-authored by
adityachandelgit
parent
285bc83a98
commit
2df8e193cc
+2
-1
@@ -50,13 +50,14 @@
|
||||
<p-tag *ngFor="let category of metadata.categories" [value]="category" class="shrink-0"></p-tag>
|
||||
</div>
|
||||
|
||||
<div class="grid gap-x-20 gap-y-2 pt-6" style="grid-template-columns: repeat(3, max-content);">
|
||||
<div class="grid gap-x-20 gap-y-2 pt-6" style="grid-template-columns: repeat(4, max-content);">
|
||||
<p class="whitespace-nowrap"><span class="font-bold">Publisher:</span> {{ metadata.publisher || '-' }}</p>
|
||||
<p class="whitespace-nowrap"><span class="font-bold">Published:</span> {{ metadata.publishedDate || '-' }}</p>
|
||||
<p class="whitespace-nowrap"><span class="font-bold">Language:</span> {{ metadata.language || '-' }}</p>
|
||||
<p class="whitespace-nowrap"><span class="font-bold">ISBN 10:</span> {{ metadata.isbn10 || '-' }}</p>
|
||||
<p class="whitespace-nowrap"><span class="font-bold">ISBN 13:</span> {{ metadata.isbn13 || '-' }}</p>
|
||||
<p class="whitespace-nowrap"><span class="font-bold">Page Count:</span> {{ metadata.pageCount || '-' }}</p>
|
||||
<p class="whitespace-nowrap"><span class="font-bold">File Size:</span> {{ getFileSizeInMB() }}</p>
|
||||
</div>
|
||||
|
||||
<p class="pt-2"><span class="font-bold">File Path:</span> {{ book?.filePath }}</p>
|
||||
|
||||
+9
@@ -154,4 +154,13 @@ export class MetadataViewerComponent implements OnInit {
|
||||
}
|
||||
return lockedKeys.every(key => metadata[key] === true);
|
||||
}
|
||||
|
||||
getFileSizeInMB(): string {
|
||||
const sizeKb = this.book?.fileSizeKb;
|
||||
if (sizeKb != null) {
|
||||
const sizeMb = sizeKb / 1024;
|
||||
return `${sizeMb.toFixed(2)} MB`;
|
||||
}
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user