Refactor book service in BE and FE (#2013)

* Refactor book service in BE and FE

* Add missing method

---------

Co-authored-by: acx10 <acx10@users.noreply.github.com>
This commit is contained in:
ACX
2025-12-28 19:37:35 -07:00
committed by GitHub
co-authored by acx10
parent 60095c2173
commit 01446c2537
37 changed files with 2085 additions and 807 deletions
@@ -3,7 +3,7 @@ import {Tooltip} from 'primeng/tooltip';
export type DocType = 'kobo' | 'opds' | 'metadataManager' | 'koReader' | 'email'
| 'amazonCookie' | 'fetchConfig' | 'hardcover' | 'taskManagement' | 'fileNamePatterns'
| 'authentication';
| 'authentication' | 'telemetry';
@Component({
selector: 'app-external-doc-link',
@@ -39,6 +39,7 @@ export class ExternalDocLinkComponent {
taskManagement: `${this.BASE_URL}/tools/task-manager`,
fileNamePatterns: `${this.BASE_URL}/metadata/file-naming-patterns`,
authentication: `${this.BASE_URL}/authentication/overview#setting-up-oidc`,
telemetry: `${this.BASE_URL}/tools/telemetry`
};
@Input() docType!: DocType;
@@ -12,7 +12,7 @@ import {DomSanitizer, SafeHtml} from '@angular/platform-browser';
template: `
@if (icon) {
@if (icon.type === 'PRIME_NG') {
<i [class]="getPrimeNgIconClass(icon.value)" [ngClass]="iconClass" [ngStyle]="iconStyle"></i>
<i [class]="getPrimeNgIconClass(icon.value)" [ngClass]="iconClass" [ngStyle]="getPrimeNgStyle()"></i>
} @else {
<div
class="svg-icon-inline"
@@ -67,7 +67,7 @@ export class IconDisplayComponent implements OnInit, OnChanges {
const previousIcon = changes['icon'].previousValue;
if (currentIcon?.type === 'CUSTOM_SVG' &&
currentIcon?.value !== previousIcon?.value) {
currentIcon?.value !== previousIcon?.value) {
this.loadIconIfNeeded();
}
}
@@ -114,4 +114,20 @@ export class IconDisplayComponent implements OnInit, OnChanges {
...this.iconStyle
};
}
getPrimeNgStyle(): Record<string, string> {
const fontSize = this.size.endsWith('px')
? `${parseInt(this.size) * 0.85}px`
: `calc(${this.size} * 0.85)`;
return {
fontSize: fontSize,
width: this.size,
height: this.size,
display: 'inline-flex',
alignItems: 'center',
justifyContent: 'center',
...this.iconStyle
};
}
}