ISBN Support (#1985)
* Fixed a bug where weblinks would always show * Started to try and support ico -> png conversion by manually grabbing image data out, but it's hard as hell. * Implemented ability to parse out ISBN codes for books and ISBN-13 codes for ComicInfo. I can't figure out ISBN-10. * Fixed Favicon not working on anything but windows * Implemented ISBN support into Kavita * Don't round so much when transforming bytes
This commit is contained in:
parent
a293500f42
commit
6be9ee39f4
18 changed files with 2083 additions and 15 deletions
|
|
@ -42,4 +42,5 @@ export interface Chapter {
|
|||
*/
|
||||
volumeTitle?: string;
|
||||
webLinks: string;
|
||||
isbn: string;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,5 +85,14 @@
|
|||
</app-icon-and-title>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="chapter.isbn.length > 0">
|
||||
<div class="vr d-none d-lg-block m-2"></div>
|
||||
<div class="col-auto">
|
||||
<app-icon-and-title label="ISBN" [clickable]="false" fontClasses="fa-solid fa-barcode" title="ISBN">
|
||||
{{chapter.isbn}}
|
||||
</app-icon-and-title>
|
||||
</div>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
</div>
|
||||
|
|
@ -56,6 +56,7 @@ export class EntityInfoCardsComponent implements OnInit, OnDestroy {
|
|||
}
|
||||
|
||||
get WebLinks() {
|
||||
if (this.chapter.webLinks === '') return [];
|
||||
return this.chapter.webLinks.split(',');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ export class BytesPipe implements PipeTransform {
|
|||
*
|
||||
* Credit: https://stackoverflow.com/questions/10420352/converting-file-size-in-bytes-to-human-readable-string
|
||||
*/
|
||||
transform(bytes: number, si=true, dp=0): string {
|
||||
transform(bytes: number, si=true, dp=1): string {
|
||||
const thresh = si ? 1000 : 1024;
|
||||
|
||||
if (Math.abs(bytes) < thresh) {
|
||||
|
|
@ -35,8 +35,12 @@ export class BytesPipe implements PipeTransform {
|
|||
++u;
|
||||
} while (Math.round(Math.abs(bytes) * r) / r >= thresh && u < units.length - 1);
|
||||
|
||||
const fixed = bytes.toFixed(dp);
|
||||
if ((fixed + '').endsWith('.0')) {
|
||||
return bytes.toFixed(0) + ' ' + units[u];
|
||||
}
|
||||
|
||||
return bytes.toFixed(dp) + ' ' + units[u];
|
||||
return fixed + ' ' + units[u];
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ export class SeriesMetadataDetailComponent implements OnChanges {
|
|||
}
|
||||
|
||||
get WebLinks() {
|
||||
if (this.seriesMetadata?.webLinks === '') return [];
|
||||
return this.seriesMetadata?.webLinks.split(',') || [];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue