diff --git a/booklore-ui/src/app/features/book/components/book-browser/book-card/book-card.component.html b/booklore-ui/src/app/features/book/components/book-browser/book-card/book-card.component.html index 703543d28..7df34472d 100644 --- a/booklore-ui/src/app/features/book/components/book-browser/book-card/book-card.component.html +++ b/booklore-ui/src/app/features/book/components/book-browser/book-card/book-card.component.html @@ -39,7 +39,10 @@ } @if (!_isSeriesViewActive && hasDigitalFile()) { - + } @if (isCheckboxEnabled) { @@ -53,7 +56,7 @@ } @if (hasProgress) { -
+
@if (_progressPercentage !== null) { (); @@ -177,6 +180,31 @@ export class BookCardComponent implements OnInit, OnChanges, OnDestroy { this._seriesCountTooltip = this.t.translate('book.card.alt.seriesCollapsed', { count: this.book.seriesCount }); this._titleTooltip = this.t.translate('book.card.alt.titleTooltip', { title: this._displayTitle }); + + const progressParts: string[] = []; + if (this._progressPercentage !== null) { + progressParts.push(`${this._progressPercentage}% (BookLore)`); + } + if (this._koProgressPercentage !== null) { + progressParts.push(`${this._koProgressPercentage}% (KOReader)`); + } + if (this._koboProgressPercentage !== null) { + progressParts.push(`${this._koboProgressPercentage}% (Kobo)`); + } + this._progressTooltip = progressParts.join(' | '); + + const maxProgress = Math.max( + this._progressPercentage ?? 0, + this._koProgressPercentage ?? 0, + this._koboProgressPercentage ?? 0 + ); + this._isContinueReading = maxProgress > 0 && maxProgress < 100; + + if (this._isAudiobook) { + this._readButtonIcon = this._isContinueReading ? 'pi pi-forward' : 'pi pi-play'; + } else { + this._readButtonIcon = this._isContinueReading ? 'pi pi-forward' : 'pi pi-book'; + } } get hasProgress(): boolean { @@ -195,6 +223,14 @@ export class BookCardComponent implements OnInit, OnChanges, OnDestroy { return this._readStatusTooltip; } + get progressTooltip(): string { + return this._progressTooltip; + } + + get readButtonIcon(): string { + return this._readButtonIcon; + } + get displayTitle(): string | undefined { return this._displayTitle; } diff --git a/booklore-ui/src/i18n/en/book.json b/booklore-ui/src/i18n/en/book.json index 8dd2f6ced..53550251f 100644 --- a/booklore-ui/src/i18n/en/book.json +++ b/booklore-ui/src/i18n/en/book.json @@ -133,7 +133,8 @@ "viewDetails": "View book details", "readBook": "Read book", "playAudiobook": "Play audiobook", - "bookMenu": "Book actions menu" + "bookMenu": "Book actions menu", + "continueReading": "Continue reading" } }, "notes": { diff --git a/booklore-ui/src/i18n/es/book.json b/booklore-ui/src/i18n/es/book.json index 2ace9fabd..e7d395176 100644 --- a/booklore-ui/src/i18n/es/book.json +++ b/booklore-ui/src/i18n/es/book.json @@ -133,7 +133,8 @@ "viewDetails": "Ver detalles del libro", "readBook": "Leer libro", "playAudiobook": "Reproducir audiolibro", - "bookMenu": "MenĂº de acciones del libro" + "bookMenu": "MenĂº de acciones del libro", + "continueReading": "Continuar leyendo" } }, "notes": {