Redesign series page layout and book list tab (#2847)
* fix: enlarge stacked covers and improve hero section spacing on series page * Redesign series page hero layout with single cover, colorful metadata cards, and metadata-viewer style description * Revamp book list tab with card layout, action buttons, progress bars, ratings, and format type colors --------- Co-authored-by: acx10 <acx10@users.noreply.github.com>
This commit is contained in:
+417
-183
@@ -7,6 +7,10 @@
|
||||
<i [class]="'pi pi-crown'"></i>
|
||||
{{ t('seriesDetailsTab') }}
|
||||
</p-tab>
|
||||
<p-tab value="list">
|
||||
<i [class]="'pi pi-list'"></i>
|
||||
{{ t('bookListTab') }}
|
||||
</p-tab>
|
||||
</p-tablist>
|
||||
<p-tabpanels class="tabpanels-responsive">
|
||||
<p-tabpanel value="view">
|
||||
@@ -15,214 +19,444 @@
|
||||
<div class="series-main">
|
||||
<div class="series-details">
|
||||
|
||||
<div class="series-info-section">
|
||||
|
||||
<div class="series-title-block">
|
||||
<div class="series-title-row">
|
||||
<h2 class="series-title">
|
||||
{{ seriesTitle$ | async }}
|
||||
</h2>
|
||||
<!-- HERO: Cover + Identity info -->
|
||||
<div class="series-hero">
|
||||
@if (coverBook$ | async; as coverBook) {
|
||||
<div class="hero-cover-section">
|
||||
<img
|
||||
[src]="getBookThumbnailUrl(coverBook)"
|
||||
class="hero-cover-img"
|
||||
[alt]="coverBook.metadata?.title || ''"
|
||||
loading="lazy"
|
||||
decoding="async"/>
|
||||
</div>
|
||||
}
|
||||
|
||||
<p class="series-authors">
|
||||
@for (author of firstBook.metadata?.authors; track $index; let isLast = $last) {
|
||||
<a class="author-link" (click)="goToAuthorBooks(author)">
|
||||
{{ author }}
|
||||
</a>
|
||||
@if (!isLast) {
|
||||
<span>, </span>
|
||||
<div class="hero-info">
|
||||
<h2 class="series-title">{{ seriesTitle$ | async }}</h2>
|
||||
|
||||
@if (allAuthors$ | async; as authors) {
|
||||
<p class="series-authors">
|
||||
@for (author of authors; track $index; let isLast = $last) {
|
||||
<a class="author-link" (click)="goToAuthorBooks(author)">{{ author }}</a>
|
||||
@if (!isLast) {<span>, </span>}
|
||||
}
|
||||
</p>
|
||||
}
|
||||
|
||||
@if (allCategories$ | async; as categories) {
|
||||
@if (categories.length) {
|
||||
<div class="categories-scroll">
|
||||
<div class="categories-list">
|
||||
@for (category of categories; track category) {
|
||||
<a (click)="goToCategory(category)" class="category-link">
|
||||
<app-tag color="red" size="xs">{{ category }}</app-tag>
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
<div class="metadata-cards">
|
||||
@if (allPublishers$ | async; as publishers) {
|
||||
@if (publishers.length) {
|
||||
<span class="meta-card meta-card--publisher" (click)="goToPublisher(publishers[0])">
|
||||
<i class="pi pi-building"></i>
|
||||
@for (pub of publishers; track pub; let isLast = $last) {
|
||||
{{ pub }}{{ isLast ? '' : ', ' }}
|
||||
}
|
||||
</span>
|
||||
}
|
||||
}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@if (firstBook.metadata?.categories?.length) {
|
||||
<div class="categories-scroll">
|
||||
<div class="categories-list">
|
||||
@for (category of firstBook.metadata?.categories; track category) {
|
||||
<a (click)="goToCategory(category)" class="category-link">
|
||||
<p-tag [value]="category"></p-tag>
|
||||
</a>
|
||||
<span class="meta-card meta-card--books">
|
||||
<i class="pi pi-book"></i>
|
||||
{{ books.length }} {{ books.length === 1 ? t('book') : t('books') }}
|
||||
</span>
|
||||
@if (yearsRange$ | async; as years) {
|
||||
<span class="meta-card meta-card--years">
|
||||
<i class="pi pi-calendar"></i>
|
||||
{{ years }}
|
||||
</span>
|
||||
}
|
||||
@if (seriesStats$ | async; as stats) {
|
||||
@if (stats.totalPages > 0) {
|
||||
<span class="meta-card meta-card--pages">
|
||||
<i class="pi pi-file"></i>
|
||||
{{ stats.totalPages | number }} {{ t('stats.totalPages') }}
|
||||
</span>
|
||||
}
|
||||
@if (stats.formatCounts.size > 0) {
|
||||
<span class="meta-card meta-card--format">
|
||||
<i class="pi pi-tag"></i>
|
||||
@for (entry of stats.formatCounts | keyvalue; track entry.key) {
|
||||
{{ entry.key }}{{ $last ? '' : ', ' }}
|
||||
}
|
||||
</span>
|
||||
}
|
||||
@if (stats.totalAudioDurationSeconds > 0) {
|
||||
<span class="meta-card meta-card--audio">
|
||||
<i class="pi pi-headphones"></i>
|
||||
{{ formatDuration(stats.totalAudioDurationSeconds) }}
|
||||
</span>
|
||||
}
|
||||
}
|
||||
@if (allLanguages$ | async; as languages) {
|
||||
@if (languages.length) {
|
||||
<span class="meta-card meta-card--language">
|
||||
<i class="pi pi-globe"></i>
|
||||
{{ languages.join(', ') }}
|
||||
</span>
|
||||
}
|
||||
}
|
||||
@if (seriesCompletion$ | async; as completion) {
|
||||
<span class="meta-card meta-card--owned">
|
||||
<i class="pi pi-check-circle"></i>
|
||||
{{ completion.owned }}/{{ completion.total }} {{ t('stats.owned') }}
|
||||
</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<div class="metadata-section-padding">
|
||||
<div class="metadata-grid">
|
||||
<p>
|
||||
<span class="metadata-label">{{ t('publisher') }} </span>
|
||||
@if (firstBook.metadata?.publisher; as publisher) {
|
||||
<span class="publisher-link" (click)="goToPublisher(publisher)">
|
||||
{{publisher}}
|
||||
</span>
|
||||
} @else {
|
||||
<span>-</span>
|
||||
}
|
||||
</p>
|
||||
<p><strong>{{ t('years') }}</strong> {{ (yearsRange$ | async) || '-' }}</p>
|
||||
<p><strong>{{ t('numberOfBooks') }}</strong> {{ books.length || 0}}</p>
|
||||
<p><strong>{{ t('language') }}</strong> {{ firstBook.metadata?.language || "-"}}</p>
|
||||
<p><strong>{{ t('readStatus') }}</strong>
|
||||
@let s = seriesReadStatus$ | async;
|
||||
<span class="status-badge"
|
||||
[ngClass]="getStatusSeverityClass(s || 'UNREAD')">
|
||||
{{ getStatusLabel(s) }}
|
||||
@if (s === 'PARTIALLY_READ') {
|
||||
({{ seriesReadProgress$ | async }})
|
||||
}
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- DESCRIPTION -->
|
||||
<div class="description-box">
|
||||
<div #descriptionContent [ngClass]="{ 'line-clamp-5': !isExpanded, 'line-clamp-none': isExpanded }"
|
||||
class="description-container">
|
||||
<div class="readonly-editor"
|
||||
[innerHTML]="(firstDescription$ | async) || t('noDescription')"></div>
|
||||
</div>
|
||||
@if (isExpanded || isOverflowing) {
|
||||
<p-button [label]="isExpanded ? t('showLess') : t('showMore')"
|
||||
[icon]="isExpanded ? 'pi pi-chevron-up' : 'pi pi-chevron-down'" iconPos="right" size="small" text
|
||||
(click)="toggleExpand()">
|
||||
</p-button>
|
||||
}
|
||||
</div>
|
||||
<!-- Ratings -->
|
||||
@if (seriesStats$ | async; as stats) {
|
||||
@if (stats.avgPersonalRating != null || stats.avgGoodreads != null || stats.avgAmazon != null || stats.avgHardcover != null) {
|
||||
<div class="ratings-row">
|
||||
@if (stats.avgPersonalRating != null) {
|
||||
<div class="rating-chip">
|
||||
<i class="pi pi-star-fill rating-icon personal"></i>
|
||||
<span class="rating-value">{{ stats.avgPersonalRating | number:'1.1-1' }}/10</span>
|
||||
<span class="rating-label">{{ t('stats.avgPersonalRating') }}</span>
|
||||
</div>
|
||||
}
|
||||
@if (stats.avgGoodreads != null) {
|
||||
<div class="rating-chip">
|
||||
<i class="pi pi-star-fill rating-icon goodreads"></i>
|
||||
<span class="rating-value">{{ getRatingPercent(stats.avgGoodreads) }}%</span>
|
||||
<span class="rating-label">{{ t('stats.avgGoodreads') }}</span>
|
||||
</div>
|
||||
}
|
||||
@if (stats.avgAmazon != null) {
|
||||
<div class="rating-chip">
|
||||
<i class="pi pi-star-fill rating-icon amazon"></i>
|
||||
<span class="rating-value">{{ getRatingPercent(stats.avgAmazon) }}%</span>
|
||||
<span class="rating-label">{{ t('stats.avgAmazon') }}</span>
|
||||
</div>
|
||||
}
|
||||
@if (stats.avgHardcover != null) {
|
||||
<div class="rating-chip">
|
||||
<i class="pi pi-star-fill rating-icon hardcover"></i>
|
||||
<span class="rating-value">{{ getRatingPercent(stats.avgHardcover) }}%</span>
|
||||
<span class="rating-label">{{ t('stats.avgHardcover') }}</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
<!-- Next Up + Progress (pushed to bottom, aligned with cover) -->
|
||||
<div class="hero-status">
|
||||
@if (nextUp$ | async; as nextUp) {
|
||||
<div class="next-up-card" (click)="readBook(nextUp.book.id)">
|
||||
<img [src]="nextUp.thumbnailUrl"
|
||||
[alt]="nextUp.book.metadata?.title || ''"
|
||||
class="next-up-thumb"
|
||||
loading="lazy"/>
|
||||
<div class="next-up-info">
|
||||
<span class="next-up-label">
|
||||
<i class="pi pi-bookmark-fill"></i>
|
||||
{{ nextUp.isReading ? t('continueReading') : t('nextUp') }}
|
||||
</span>
|
||||
<span class="next-up-title">{{ nextUp.book.metadata?.title || '' }}</span>
|
||||
@if (nextUp.isReading && nextUp.progressPercent != null) {
|
||||
<div class="next-up-progress-row">
|
||||
<p-progressBar
|
||||
[value]="nextUp.progressPercent"
|
||||
[showValue]="false"
|
||||
class="next-up-progress">
|
||||
</p-progressBar>
|
||||
<span class="next-up-percent">{{ nextUp.progressPercent }}%</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (readStatusBreakdown$ | async; as segments) {
|
||||
@if (segments.length) {
|
||||
<div class="read-progress-card">
|
||||
<div class="read-progress-section">
|
||||
<div class="read-progress-bar">
|
||||
@for (seg of segments; track seg.status) {
|
||||
<div class="read-progress-segment"
|
||||
[ngStyle]="{'width': seg.percent + '%', 'background-color': getStatusColor(seg.status)}"
|
||||
[pTooltip]="getStatusLabel(seg.status) + ': ' + seg.count">
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="read-progress-legend">
|
||||
@for (seg of segments; track seg.status) {
|
||||
<span class="legend-item"
|
||||
[ngStyle]="{'border-color': getStatusColor(seg.status)}">
|
||||
<span class="legend-dot"
|
||||
[ngStyle]="{'background-color': getStatusColor(seg.status)}"></span>
|
||||
{{ getStatusLabel(seg.status) }} ({{ seg.count }})
|
||||
</span>
|
||||
}
|
||||
@let readProg = seriesReadProgress$ | async;
|
||||
@if (readProg) {
|
||||
<span class="read-percent-label">
|
||||
{{ t('readPercent', { progress: readProg }) }}
|
||||
</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="series-items-grid" #Container
|
||||
[ngStyle]="{'grid-template-columns': 'repeat(auto-fill, minmax(' + gridColumnMinWidth + ', 1fr))'}">
|
||||
@for (book of books; track book; let i = $index) {
|
||||
<div class="grid-item"
|
||||
[ngStyle]="{width: currentCardSize.width + 'px', height: currentCardSize.height + 'px'}">
|
||||
<app-book-card
|
||||
[index]="i"
|
||||
[book]="book"
|
||||
[isCheckboxEnabled]="true"
|
||||
[isSelected]="selectedBooks.has(book.id)"
|
||||
(checkboxClick)="onCheckboxClicked($event)"
|
||||
[onBookSelect]="handleBookSelect.bind(this)"
|
||||
[isSeriesCollapsed]="false"
|
||||
[overlayPreferenceService]="bookCardOverlayPreferenceService">
|
||||
</app-book-card>
|
||||
</div>
|
||||
}
|
||||
@if (books.length === 0) {
|
||||
<div class="empty-state">{{ t('noBooksFound') }}</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="description-section">
|
||||
<div class="description-header">
|
||||
<i class="pi pi-align-left"></i>
|
||||
<span>{{ t('synopsis') }}</span>
|
||||
</div>
|
||||
<div class="description-body">
|
||||
<div #descriptionContent [ngClass]="{ 'line-clamp-7': !isExpanded }"
|
||||
class="description-content">
|
||||
<div class="description-html"
|
||||
[innerHTML]="(firstDescription$ | async) || t('noDescription')"></div>
|
||||
</div>
|
||||
@if (isExpanded || isOverflowing) {
|
||||
<button class="expand-toggle" (click)="toggleExpand()">
|
||||
{{ isExpanded ? t('showLess') : t('showMore') }}
|
||||
<i class="pi" [ngClass]="isExpanded ? 'pi-chevron-up' : 'pi-chevron-down'"></i>
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3 class="section-title">
|
||||
<i class="pi pi-objects-column"></i>
|
||||
{{ t('booksInSeries') }}
|
||||
</h3>
|
||||
<div class="series-items-grid" #Container
|
||||
[ngStyle]="{'grid-template-columns': 'repeat(auto-fill, minmax(' + gridColumnMinWidth + ', 1fr))'}">
|
||||
@for (book of books; track book; let i = $index) {
|
||||
<div class="grid-item"
|
||||
[ngStyle]="{width: currentCardSize.width + 'px', height: currentCardSize.height + 'px'}">
|
||||
<app-book-card
|
||||
[index]="i"
|
||||
[book]="book"
|
||||
[isCheckboxEnabled]="true"
|
||||
[isSelected]="selectedBooks.has(book.id)"
|
||||
(checkboxClick)="onCheckboxClicked($event)"
|
||||
[onBookSelect]="handleBookSelect.bind(this)"
|
||||
[isSeriesCollapsed]="false"
|
||||
[overlayPreferenceService]="bookCardOverlayPreferenceService">
|
||||
</app-book-card>
|
||||
</div>
|
||||
}
|
||||
@if (books.length === 0) {
|
||||
<div class="empty-state">{{ t('noBooksFound') }}</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</p-tabpanel>
|
||||
|
||||
</p-tabpanel>
|
||||
</p-tabpanels>
|
||||
</p-tabs>
|
||||
@if (selectedBooks.size > 0) {
|
||||
@if (userService.userState$ | async; as userState) {
|
||||
<div class="book-browser-footer" [@slideInOut]>
|
||||
<div class="footer-content">
|
||||
<div class="footer-left">
|
||||
<div class="selected-count-badge">
|
||||
<i class="pi pi-check-circle badge-icon"></i>
|
||||
<span class="badge-count" style="color: var(--primary-color)">{{ selectedBooks.size }}</span>
|
||||
<span class="badge-label">{{ t('selected') }}</span>
|
||||
</div>
|
||||
<!-- BOOK LIST TAB -->
|
||||
<p-tabpanel value="list">
|
||||
<div class="book-list-container">
|
||||
@for (book of books; track book.id; let i = $index) {
|
||||
<div class="book-list-card">
|
||||
<div class="list-number-col">
|
||||
<span class="list-series-number">
|
||||
{{ book.metadata?.seriesNumber != null ? '#' + book.metadata?.seriesNumber : '-' }}
|
||||
</span>
|
||||
</div>
|
||||
<img [src]="getBookThumbnailUrl(book)"
|
||||
[alt]="book.metadata?.title || ''"
|
||||
class="list-thumb"
|
||||
loading="lazy"/>
|
||||
<div class="list-book-info">
|
||||
<span class="list-book-title">{{ book.metadata?.title || '' }}</span>
|
||||
<div class="list-book-meta">
|
||||
@if (book.metadata?.authors?.length) {
|
||||
<span class="list-book-authors">{{ book.metadata!.authors!.join(', ') }}</span>
|
||||
}
|
||||
@if (book.metadata?.publishedDate; as date) {
|
||||
<span class="list-meta-dot">·</span>
|
||||
<span class="list-book-year">{{ date }}</span>
|
||||
}
|
||||
@if (book.metadata?.pageCount; as pages) {
|
||||
<span class="list-meta-dot">·</span>
|
||||
<span class="list-book-pages">{{ pages }} {{ t('listPages') }}</span>
|
||||
}
|
||||
</div>
|
||||
@if (getBookProgress(book); as progress) {
|
||||
<div class="list-progress-row">
|
||||
<div class="list-progress-bar">
|
||||
<div class="list-progress-fill" [ngStyle]="{'width': progress + '%'}"></div>
|
||||
</div>
|
||||
<span class="list-progress-text">{{ progress }}%</span>
|
||||
</div>
|
||||
}
|
||||
@if (book.personalRating) {
|
||||
<div class="list-rating-row">
|
||||
@for (star of [1,2,3,4,5]; track star) {
|
||||
<i class="pi list-star"
|
||||
[ngClass]="book.personalRating! >= star * 2 ? 'pi-star-fill' : (book.personalRating! >= star * 2 - 1 ? 'pi-star-half-fill' : 'pi-star')">
|
||||
</i>
|
||||
}
|
||||
<span class="list-rating-value">{{ book.personalRating }}/10</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="list-right-col">
|
||||
<div class="list-badges">
|
||||
<span class="list-status-badge"
|
||||
[ngStyle]="{'background-color': getStatusColor(book.readStatus)}">
|
||||
{{ getStatusLabel(book.readStatus) }}
|
||||
</span>
|
||||
@if (book.primaryFile?.bookType; as bookType) {
|
||||
<span class="list-format-badge"
|
||||
[style.background-color]="'color-mix(in srgb, var(--book-type-' + bookType.toLowerCase() + '-color) 20%, transparent)'"
|
||||
[style.border-color]="'var(--book-type-' + bookType.toLowerCase() + '-color)'"
|
||||
[style.color]="'var(--book-type-' + bookType.toLowerCase() + '-color)'">
|
||||
{{ bookType }}
|
||||
</span>
|
||||
}
|
||||
</div>
|
||||
<div class="list-actions">
|
||||
<button class="list-action-btn btn-read" (click)="readBook(book.id); $event.stopPropagation()"
|
||||
[pTooltip]="t('readButton')" tooltipPosition="top">
|
||||
<i class="pi pi-book"></i>
|
||||
</button>
|
||||
<button class="list-action-btn btn-details" (click)="viewBookDetails(book.id); $event.stopPropagation()"
|
||||
[pTooltip]="t('viewDetails')" tooltipPosition="top">
|
||||
<i class="pi pi-info-circle"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (books.length === 0) {
|
||||
<div class="empty-state">{{ t('noBooksFound') }}</div>
|
||||
}
|
||||
</div>
|
||||
<div class="footer-center">
|
||||
<div class="footer-action-group">
|
||||
@if (hasMetadataMenuItems) {
|
||||
<p-tieredMenu #menu [model]="metadataMenuItems" [popup]="true" appendTo="body"/>
|
||||
<p-button
|
||||
(click)="menu.toggle($event)"
|
||||
[pTooltip]="t('tooltip.metadataActions')"
|
||||
tooltipPosition="top"
|
||||
outlined="true"
|
||||
severity="info"
|
||||
icon="pi pi-database">
|
||||
</p-button>
|
||||
}
|
||||
<p-button
|
||||
icon="pi pi-bookmark-fill"
|
||||
outlined="true"
|
||||
severity="info"
|
||||
(onClick)="openShelfAssigner()"
|
||||
[pTooltip]="t('tooltip.assignToShelf')"
|
||||
tooltipPosition="top">
|
||||
</p-button>
|
||||
@if (userState.user!.permissions.canBulkLockUnlockMetadata) {
|
||||
<p-button
|
||||
outlined="true"
|
||||
icon="pi pi-lock"
|
||||
severity="info"
|
||||
(click)="lockUnlockMetadata()"
|
||||
[pTooltip]="t('tooltip.lockUnlockMetadata')"
|
||||
tooltipPosition="top">
|
||||
</p-button>
|
||||
}
|
||||
@if (userState.user!.permissions.canMoveOrganizeFiles && (appSettingsService.appSettings$ | async)?.diskType === 'LOCAL') {
|
||||
<p-button
|
||||
outlined="true"
|
||||
icon="pi pi-arrows-h"
|
||||
severity="info"
|
||||
(click)="moveFiles()"
|
||||
[pTooltip]="t('tooltip.organizeFiles')"
|
||||
tooltipPosition="top">
|
||||
</p-button>
|
||||
}
|
||||
@if (hasMoreActionsItems) {
|
||||
<div class="more-actions-wrapper">
|
||||
</p-tabpanel>
|
||||
|
||||
</p-tabpanels>
|
||||
</p-tabs>
|
||||
@if (selectedBooks.size > 0) {
|
||||
@if (userService.userState$ | async; as userState) {
|
||||
<div class="book-browser-footer" [@slideInOut]>
|
||||
<div class="footer-content">
|
||||
<div class="footer-left">
|
||||
<div class="selected-count-badge">
|
||||
<i class="pi pi-check-circle badge-icon"></i>
|
||||
<span class="badge-count" style="color: var(--primary-color)">{{ selectedBooks.size }}</span>
|
||||
<span class="badge-label">{{ t('selected') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer-center">
|
||||
<div class="footer-action-group">
|
||||
@if (hasMetadataMenuItems) {
|
||||
<p-tieredMenu #menu [model]="metadataMenuItems" [popup]="true" appendTo="body"/>
|
||||
<p-button
|
||||
(click)="menu.toggle($event)"
|
||||
[pTooltip]="t('tooltip.moreActions')"
|
||||
[pTooltip]="t('tooltip.metadataActions')"
|
||||
tooltipPosition="top"
|
||||
outlined="true"
|
||||
severity="info"
|
||||
icon="pi pi-ellipsis-v">
|
||||
icon="pi pi-database">
|
||||
</p-button>
|
||||
<p-tieredMenu #menu [model]="moreActionsMenuItems" [popup]="true" appendTo="body"/>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<p-divider layout="vertical"></p-divider>
|
||||
<div class="footer-action-group">
|
||||
<p-button
|
||||
outlined="true"
|
||||
icon="pi pi-check-square"
|
||||
severity="success"
|
||||
(click)="selectAllBooks()"
|
||||
[pTooltip]="t('tooltip.selectAll')"
|
||||
tooltipPosition="top">
|
||||
</p-button>
|
||||
<p-button
|
||||
outlined="true"
|
||||
icon="pi pi-times"
|
||||
severity="warn"
|
||||
(click)="deselectAllBooks()"
|
||||
[pTooltip]="t('tooltip.deselectAll')"
|
||||
tooltipPosition="top">
|
||||
</p-button>
|
||||
</div>
|
||||
@if (userState.user!.permissions.admin || userState.user!.permissions.canDeleteBook) {
|
||||
}
|
||||
<p-button
|
||||
icon="pi pi-bookmark-fill"
|
||||
outlined="true"
|
||||
severity="info"
|
||||
(onClick)="openShelfAssigner()"
|
||||
[pTooltip]="t('tooltip.assignToShelf')"
|
||||
tooltipPosition="top">
|
||||
</p-button>
|
||||
@if (userState.user!.permissions.canBulkLockUnlockMetadata) {
|
||||
<p-button
|
||||
outlined="true"
|
||||
icon="pi pi-lock"
|
||||
severity="info"
|
||||
(click)="lockUnlockMetadata()"
|
||||
[pTooltip]="t('tooltip.lockUnlockMetadata')"
|
||||
tooltipPosition="top">
|
||||
</p-button>
|
||||
}
|
||||
@if (userState.user!.permissions.canMoveOrganizeFiles && (appSettingsService.appSettings$ | async)?.diskType === 'LOCAL') {
|
||||
<p-button
|
||||
outlined="true"
|
||||
icon="pi pi-arrows-h"
|
||||
severity="info"
|
||||
(click)="moveFiles()"
|
||||
[pTooltip]="t('tooltip.organizeFiles')"
|
||||
tooltipPosition="top">
|
||||
</p-button>
|
||||
}
|
||||
@if (hasMoreActionsItems) {
|
||||
<div class="more-actions-wrapper">
|
||||
<p-button
|
||||
(click)="menu.toggle($event)"
|
||||
[pTooltip]="t('tooltip.moreActions')"
|
||||
tooltipPosition="top"
|
||||
outlined="true"
|
||||
severity="info"
|
||||
icon="pi pi-ellipsis-v">
|
||||
</p-button>
|
||||
<p-tieredMenu #menu [model]="moreActionsMenuItems" [popup]="true" appendTo="body"/>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<p-divider layout="vertical"></p-divider>
|
||||
<p-button
|
||||
outlined="true"
|
||||
icon="pi pi-trash"
|
||||
severity="danger"
|
||||
(click)="confirmDeleteBooks()"
|
||||
[pTooltip]="t('tooltip.deleteSelected')"
|
||||
tooltipPosition="top">
|
||||
</p-button>
|
||||
}
|
||||
<div class="footer-action-group">
|
||||
<p-button
|
||||
outlined="true"
|
||||
icon="pi pi-check-square"
|
||||
severity="success"
|
||||
(click)="selectAllBooks()"
|
||||
[pTooltip]="t('tooltip.selectAll')"
|
||||
tooltipPosition="top">
|
||||
</p-button>
|
||||
<p-button
|
||||
outlined="true"
|
||||
icon="pi pi-times"
|
||||
severity="warn"
|
||||
(click)="deselectAllBooks()"
|
||||
[pTooltip]="t('tooltip.deselectAll')"
|
||||
tooltipPosition="top">
|
||||
</p-button>
|
||||
</div>
|
||||
@if (userState.user!.permissions.admin || userState.user!.permissions.canDeleteBook) {
|
||||
<p-divider layout="vertical"></p-divider>
|
||||
<p-button
|
||||
outlined="true"
|
||||
icon="pi pi-trash"
|
||||
severity="danger"
|
||||
(click)="confirmDeleteBooks()"
|
||||
[pTooltip]="t('tooltip.deleteSelected')"
|
||||
tooltipPosition="top">
|
||||
</p-button>
|
||||
}
|
||||
</div>
|
||||
<div class="footer-right"></div>
|
||||
</div>
|
||||
<div class="footer-right"></div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
}
|
||||
</div>
|
||||
|
||||
} @else {
|
||||
|
||||
+707
-109
@@ -19,7 +19,6 @@
|
||||
.series-main {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
@@ -29,47 +28,56 @@
|
||||
}
|
||||
}
|
||||
|
||||
.series-info-section {
|
||||
// ── Hero ──
|
||||
|
||||
.series-hero {
|
||||
display: flex;
|
||||
gap: 1.5rem;
|
||||
padding: 0.5rem;
|
||||
align-items: stretch;
|
||||
|
||||
@media (max-width: 767px) {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.hero-cover-section {
|
||||
flex-shrink: 0;
|
||||
|
||||
@media (max-width: 767px) {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
.hero-cover-img {
|
||||
width: 240px;
|
||||
height: 360px;
|
||||
object-fit: cover;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
|
||||
|
||||
@media (max-width: 767px) {
|
||||
width: 180px;
|
||||
height: 270px;
|
||||
}
|
||||
}
|
||||
|
||||
.hero-info {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
text-align: center;
|
||||
gap: 1rem;
|
||||
width: 100%;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
.series-title-block {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
align-items: flex-start;
|
||||
}
|
||||
}
|
||||
|
||||
.series-title-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
text-align: center;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
justify-content: flex-start;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
.series-title {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 800;
|
||||
line-height: 1.25;
|
||||
margin: 0;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
font-size: 1.875rem;
|
||||
@@ -77,33 +85,178 @@
|
||||
}
|
||||
|
||||
.series-authors {
|
||||
font-size: 1.125rem;
|
||||
font-size: 1rem;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.author-link {
|
||||
cursor: pointer;
|
||||
color: #60a5fa;
|
||||
color: var(--primary-text-color);
|
||||
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
// ── Metadata cards ──
|
||||
|
||||
.metadata-cards {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.4rem;
|
||||
margin-top: 0.5rem;
|
||||
|
||||
@media (max-width: 767px) {
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
.meta-card {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.35rem;
|
||||
padding: 0.35rem 0.7rem;
|
||||
border-radius: 0.4rem;
|
||||
font-size: 0.85rem;
|
||||
font-weight: 600;
|
||||
border: 1px solid;
|
||||
white-space: nowrap;
|
||||
|
||||
i {
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
}
|
||||
|
||||
.meta-card--publisher {
|
||||
background: color-mix(in srgb, #3b82f6, transparent 85%);
|
||||
border-color: color-mix(in srgb, #3b82f6, transparent 60%);
|
||||
color: #93c5fd;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
background: color-mix(in srgb, #3b82f6, transparent 75%);
|
||||
}
|
||||
|
||||
i { color: #60a5fa; }
|
||||
}
|
||||
|
||||
.meta-card--books {
|
||||
background: color-mix(in srgb, #8b5cf6, transparent 85%);
|
||||
border-color: color-mix(in srgb, #8b5cf6, transparent 60%);
|
||||
color: #c4b5fd;
|
||||
|
||||
i { color: #a78bfa; }
|
||||
}
|
||||
|
||||
.meta-card--years {
|
||||
background: color-mix(in srgb, #f59e0b, transparent 85%);
|
||||
border-color: color-mix(in srgb, #f59e0b, transparent 60%);
|
||||
color: #fcd34d;
|
||||
|
||||
i { color: #fbbf24; }
|
||||
}
|
||||
|
||||
.meta-card--pages {
|
||||
background: color-mix(in srgb, #10b981, transparent 85%);
|
||||
border-color: color-mix(in srgb, #10b981, transparent 60%);
|
||||
color: #6ee7b7;
|
||||
|
||||
i { color: #34d399; }
|
||||
}
|
||||
|
||||
.meta-card--format {
|
||||
background: color-mix(in srgb, #f43f5e, transparent 85%);
|
||||
border-color: color-mix(in srgb, #f43f5e, transparent 60%);
|
||||
color: #fda4af;
|
||||
|
||||
i { color: #fb7185; }
|
||||
}
|
||||
|
||||
.meta-card--audio {
|
||||
background: color-mix(in srgb, #06b6d4, transparent 85%);
|
||||
border-color: color-mix(in srgb, #06b6d4, transparent 60%);
|
||||
color: #67e8f9;
|
||||
|
||||
i { color: #22d3ee; }
|
||||
}
|
||||
|
||||
.meta-card--language {
|
||||
background: color-mix(in srgb, #ec4899, transparent 85%);
|
||||
border-color: color-mix(in srgb, #ec4899, transparent 60%);
|
||||
color: #f9a8d4;
|
||||
|
||||
i { color: #f472b6; }
|
||||
}
|
||||
|
||||
.meta-card--owned {
|
||||
background: color-mix(in srgb, #14b8a6, transparent 85%);
|
||||
border-color: color-mix(in srgb, #14b8a6, transparent 60%);
|
||||
color: #5eead4;
|
||||
|
||||
i { color: #2dd4bf; }
|
||||
}
|
||||
|
||||
.publisher-link {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
// ── Ratings ──
|
||||
|
||||
.ratings-row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.4rem;
|
||||
|
||||
@media (max-width: 767px) {
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
.rating-chip {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.3rem;
|
||||
padding: 0.25rem 0.6rem;
|
||||
border-radius: 0.375rem;
|
||||
background: color-mix(in srgb, var(--p-surface-700), transparent 50%);
|
||||
border: 1px solid var(--border-color);
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
.rating-icon {
|
||||
font-size: 0.75rem;
|
||||
|
||||
&.personal { color: #facc15; }
|
||||
&.goodreads { color: #8b5cf6; }
|
||||
&.amazon { color: #f97316; }
|
||||
&.hardcover { color: #06b6d4; }
|
||||
}
|
||||
|
||||
.rating-value {
|
||||
font-weight: 700;
|
||||
color: var(--text-color);
|
||||
}
|
||||
|
||||
.rating-label {
|
||||
color: var(--text-secondary-color);
|
||||
font-size: 0.7rem;
|
||||
}
|
||||
|
||||
// ── Categories ──
|
||||
|
||||
.categories-scroll {
|
||||
overflow-x: auto;
|
||||
max-width: 80rem;
|
||||
padding-top: 0.5rem;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
padding-top: 0;
|
||||
}
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.categories-list {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
gap: 0.4rem;
|
||||
width: max-content;
|
||||
max-width: 1150px;
|
||||
|
||||
@media (max-width: 767px) {
|
||||
margin: 0 auto;
|
||||
}
|
||||
}
|
||||
|
||||
.category-link {
|
||||
@@ -112,95 +265,539 @@
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.metadata-section-padding {
|
||||
padding: 0 0.25rem;
|
||||
// ── Description (matches metadata-viewer) ──
|
||||
|
||||
@media (min-width: 768px) {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.metadata-grid {
|
||||
display: grid;
|
||||
padding: 0.75rem;
|
||||
row-gap: 0.625rem;
|
||||
font-size: 0.875rem;
|
||||
padding-top: 0.5rem;
|
||||
padding-bottom: 0.5rem;
|
||||
color: #d1d5db;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
grid-template-columns: repeat(5, minmax(0, 1fr));
|
||||
padding-top: 1rem;
|
||||
min-width: 60rem;
|
||||
max-width: 100rem;
|
||||
}
|
||||
}
|
||||
|
||||
.metadata-label {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.publisher-link {
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
}
|
||||
|
||||
.status-badge {
|
||||
display: inline-block;
|
||||
padding: 0.5rem 0.125rem;
|
||||
border-radius: 9999px;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 700;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.description-box {
|
||||
padding: 1rem 1rem 0.5rem;
|
||||
margin-bottom: 1rem;
|
||||
.description-section {
|
||||
background: var(--card-background);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 0.75rem;
|
||||
overflow: hidden;
|
||||
margin: 0 0.5rem;
|
||||
transition: box-shadow 0.3s ease;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
margin-bottom: 1.5rem;
|
||||
margin-left: 0.5rem;
|
||||
margin-right: 0.5rem;
|
||||
&:hover {
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
.description-container {
|
||||
transition: all 0.3s;
|
||||
.description-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
padding: 0.625rem 0.875rem;
|
||||
background: var(--surface-ground);
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
border-radius: 0.75rem 0.75rem 0 0;
|
||||
font-weight: 600;
|
||||
font-size: 0.875rem;
|
||||
color: var(--text-color);
|
||||
|
||||
i {
|
||||
font-size: 0.95rem;
|
||||
color: var(--primary-color);
|
||||
}
|
||||
}
|
||||
|
||||
.description-body {
|
||||
padding: 0.875rem;
|
||||
}
|
||||
|
||||
.description-content {
|
||||
overflow: hidden;
|
||||
transition: max-height 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.line-clamp-5 {
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 5;
|
||||
-webkit-box-orient: vertical;
|
||||
.description-content.line-clamp-7 {
|
||||
max-height: 37px;
|
||||
}
|
||||
|
||||
.description-content:not(.line-clamp-7) {
|
||||
max-height: none;
|
||||
}
|
||||
|
||||
.description-html {
|
||||
color: var(--text-color-secondary);
|
||||
line-height: 1.6;
|
||||
font-size: 0.9375rem;
|
||||
word-wrap: break-word;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
.expand-toggle {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.375rem;
|
||||
margin-top: 0.5rem;
|
||||
padding: 0.25rem 0.5rem;
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-radius: 0.25rem;
|
||||
color: var(--primary-color);
|
||||
font-size: 0.8rem;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s ease, color 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
background: var(--surface-hover);
|
||||
color: var(--primary-hover-color);
|
||||
}
|
||||
|
||||
i {
|
||||
font-size: 0.7rem;
|
||||
}
|
||||
}
|
||||
|
||||
// ── Hero status (next up + progress, aligned to cover bottom) ──
|
||||
|
||||
.hero-status {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
gap: 0.75rem;
|
||||
width: 100%;
|
||||
margin-top: auto;
|
||||
|
||||
@media (max-width: 767px) {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
// ── Reading progress ──
|
||||
|
||||
.read-progress-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0.75rem 1rem;
|
||||
border-radius: 0.5rem;
|
||||
background: color-mix(in srgb, var(--p-surface-700), transparent 50%);
|
||||
border: 1px solid var(--border-color);
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
min-width: 16rem;
|
||||
max-width: 22rem;
|
||||
}
|
||||
}
|
||||
|
||||
.read-progress-section {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.read-progress-bar {
|
||||
display: flex;
|
||||
height: 0.625rem;
|
||||
border-radius: 0.375rem;
|
||||
overflow: hidden;
|
||||
background: color-mix(in srgb, var(--p-surface-600), transparent 50%);
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
.line-clamp-none {
|
||||
-webkit-line-clamp: unset;
|
||||
.read-progress-segment {
|
||||
height: 100%;
|
||||
min-width: 4px;
|
||||
border-radius: 0.375rem;
|
||||
}
|
||||
|
||||
.readonly-editor {
|
||||
padding: 0 0.5rem;
|
||||
.read-progress-legend {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.4rem;
|
||||
margin-top: 0.5rem;
|
||||
font-size: 0.75rem;
|
||||
color: var(--text-color-secondary);
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.legend-item {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
padding: 0.1rem 0.4rem 0.1rem 0.3rem;
|
||||
border-radius: 9999px;
|
||||
border: 1px solid;
|
||||
font-size: 0.7rem;
|
||||
background: color-mix(in srgb, var(--p-surface-700), transparent 60%);
|
||||
}
|
||||
|
||||
.legend-dot {
|
||||
display: inline-block;
|
||||
width: 0.4rem;
|
||||
height: 0.4rem;
|
||||
border-radius: 50%;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.read-percent-label {
|
||||
margin-left: auto;
|
||||
font-weight: 600;
|
||||
font-size: 0.75rem;
|
||||
color: var(--text-secondary-color);
|
||||
}
|
||||
|
||||
// ── Next Up card ──
|
||||
|
||||
.next-up-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
padding: 0.6rem 0.85rem;
|
||||
border-radius: 0.5rem;
|
||||
background: color-mix(in srgb, var(--p-surface-700), transparent 50%);
|
||||
border: 1px solid var(--border-color);
|
||||
cursor: pointer;
|
||||
transition: background 0.15s ease, border-color 0.15s ease;
|
||||
flex-shrink: 0;
|
||||
|
||||
&:hover {
|
||||
background: color-mix(in srgb, var(--p-surface-700), transparent 30%);
|
||||
border-color: var(--primary-text-color);
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
min-width: 16rem;
|
||||
max-width: 22rem;
|
||||
}
|
||||
}
|
||||
|
||||
.next-up-thumb {
|
||||
width: 2.75rem;
|
||||
height: 4rem;
|
||||
object-fit: cover;
|
||||
border-radius: 0.25rem;
|
||||
flex-shrink: 0;
|
||||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
|
||||
.next-up-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.2rem;
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.next-up-label {
|
||||
font-size: 0.65rem;
|
||||
font-weight: 700;
|
||||
color: var(--text-secondary-color);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.04em;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
|
||||
i {
|
||||
font-size: 0.6rem;
|
||||
color: var(--primary-text-color);
|
||||
}
|
||||
}
|
||||
|
||||
.next-up-title {
|
||||
font-weight: 600;
|
||||
font-size: 0.85rem;
|
||||
color: var(--text-color);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.next-up-progress-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.4rem;
|
||||
margin-top: 0.15rem;
|
||||
}
|
||||
|
||||
.next-up-progress {
|
||||
flex: 1;
|
||||
height: 0.25rem;
|
||||
}
|
||||
|
||||
.next-up-percent {
|
||||
font-size: 0.7rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-secondary-color);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
// ── Section title ──
|
||||
|
||||
.section-title {
|
||||
font-size: 1.1rem;
|
||||
font-weight: 700;
|
||||
color: var(--text-color-secondary);
|
||||
margin: 0.75rem 0 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
padding: 0.75rem 0.5rem 0;
|
||||
border-top: 1px solid var(--border-color);
|
||||
|
||||
i {
|
||||
font-size: 1rem;
|
||||
color: var(--text-secondary-color);
|
||||
}
|
||||
}
|
||||
|
||||
// ── Book grid ──
|
||||
|
||||
.series-items-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(1px, 1fr));
|
||||
gap: 1.3rem;
|
||||
gap: 1rem;
|
||||
align-items: start;
|
||||
width: 100%;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
// ── Book list tab ──
|
||||
|
||||
.book-list-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
padding: 0.5rem;
|
||||
}
|
||||
|
||||
.book-list-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.85rem;
|
||||
padding: 0.65rem 0.85rem;
|
||||
cursor: pointer;
|
||||
border-radius: 0.5rem;
|
||||
background: color-mix(in srgb, var(--p-surface-700), transparent 65%);
|
||||
border: 1px solid color-mix(in srgb, var(--border-color), transparent 60%);
|
||||
transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
|
||||
|
||||
&:hover {
|
||||
background: color-mix(in srgb, var(--p-surface-700), transparent 40%);
|
||||
border-color: var(--border-color);
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
gap: 0.5rem;
|
||||
padding: 0.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
.list-number-col {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 2rem;
|
||||
height: 2rem;
|
||||
border-radius: 0.375rem;
|
||||
background: color-mix(in srgb, var(--primary-color), transparent 85%);
|
||||
}
|
||||
|
||||
.list-series-number {
|
||||
font-weight: 700;
|
||||
font-size: 0.8rem;
|
||||
color: var(--primary-color);
|
||||
}
|
||||
|
||||
.list-thumb {
|
||||
width: 2.75rem;
|
||||
height: 4rem;
|
||||
object-fit: cover;
|
||||
border-radius: 0.375rem;
|
||||
flex-shrink: 0;
|
||||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.list-book-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.2rem;
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.list-book-title {
|
||||
font-weight: 600;
|
||||
font-size: 0.95rem;
|
||||
color: var(--text-color);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.list-book-meta {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.35rem;
|
||||
font-size: 0.85rem;
|
||||
color: var(--text-color-secondary);
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.list-meta-dot {
|
||||
color: var(--text-color-secondary);
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.list-book-authors {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 16rem;
|
||||
}
|
||||
|
||||
.list-book-year,
|
||||
.list-book-pages {
|
||||
white-space: nowrap;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.list-right-col {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.list-badges {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.4rem;
|
||||
}
|
||||
|
||||
.list-status-badge {
|
||||
display: inline-block;
|
||||
padding: 0.25rem 0.6rem;
|
||||
border-radius: 9999px;
|
||||
font-size: 0.7rem;
|
||||
font-weight: 700;
|
||||
color: white;
|
||||
white-space: nowrap;
|
||||
letter-spacing: 0.02em;
|
||||
}
|
||||
|
||||
.list-format-badge {
|
||||
display: inline-block;
|
||||
padding: 0.2rem 0.5rem;
|
||||
border-radius: 0.25rem;
|
||||
font-size: 0.7rem;
|
||||
font-weight: 700;
|
||||
border: 1px solid;
|
||||
white-space: nowrap;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.03em;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
// ── List: progress bar ──
|
||||
|
||||
.list-progress-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.4rem;
|
||||
margin-top: 0.15rem;
|
||||
}
|
||||
|
||||
.list-progress-bar {
|
||||
width: 5rem;
|
||||
height: 0.25rem;
|
||||
border-radius: 0.25rem;
|
||||
background: color-mix(in srgb, var(--p-surface-600), transparent 50%);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.list-progress-fill {
|
||||
height: 100%;
|
||||
border-radius: 0.25rem;
|
||||
background: var(--primary-color);
|
||||
transition: width 0.3s ease;
|
||||
}
|
||||
|
||||
.list-progress-text {
|
||||
font-size: 0.65rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-color-secondary);
|
||||
}
|
||||
|
||||
// ── List: rating stars ──
|
||||
|
||||
.list-rating-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.1rem;
|
||||
margin-top: 0.1rem;
|
||||
}
|
||||
|
||||
.list-star {
|
||||
font-size: 0.65rem;
|
||||
color: #facc15;
|
||||
}
|
||||
|
||||
.list-rating-value {
|
||||
font-size: 0.65rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-color-secondary);
|
||||
margin-left: 0.25rem;
|
||||
}
|
||||
|
||||
// ── List: action buttons ──
|
||||
|
||||
.list-actions {
|
||||
display: flex;
|
||||
gap: 0.35rem;
|
||||
}
|
||||
|
||||
.list-action-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 2.1rem;
|
||||
height: 2.1rem;
|
||||
border-radius: 0.4rem;
|
||||
border: 1px solid;
|
||||
cursor: pointer;
|
||||
transition: all 0.15s ease;
|
||||
|
||||
i {
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
&.btn-read {
|
||||
background: color-mix(in srgb, #10b981, transparent 85%);
|
||||
border-color: color-mix(in srgb, #10b981, transparent 55%);
|
||||
color: #6ee7b7;
|
||||
|
||||
&:hover {
|
||||
background: color-mix(in srgb, #10b981, transparent 65%);
|
||||
}
|
||||
}
|
||||
|
||||
&.btn-details {
|
||||
background: color-mix(in srgb, #3b82f6, transparent 85%);
|
||||
border-color: color-mix(in srgb, #3b82f6, transparent 55%);
|
||||
color: #93c5fd;
|
||||
|
||||
&:hover {
|
||||
background: color-mix(in srgb, #3b82f6, transparent 65%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
text-align: center;
|
||||
padding: 2rem;
|
||||
color: var(--text-secondary-color);
|
||||
}
|
||||
|
||||
// ── Loading ──
|
||||
|
||||
.loading-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -210,6 +807,8 @@
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
// ── Footer ──
|
||||
|
||||
.book-browser-footer {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
@@ -275,7 +874,7 @@
|
||||
align-items: center;
|
||||
padding: 0.5rem 1rem;
|
||||
font-size: 0.9rem;
|
||||
color: #e4e4e7;
|
||||
color: var(--text-color);
|
||||
|
||||
i {
|
||||
font-size: 1rem;
|
||||
@@ -305,4 +904,3 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+269
-19
@@ -1,10 +1,10 @@
|
||||
import {FormsModule} from "@angular/forms";
|
||||
import {Button} from "primeng/button";
|
||||
import {ActivatedRoute, Router} from "@angular/router";
|
||||
import {AsyncPipe, NgClass, NgStyle} from "@angular/common";
|
||||
import {AsyncPipe, DecimalPipe, KeyValuePipe, NgClass, NgStyle} from "@angular/common";
|
||||
import {filter, finalize, map, switchMap, tap} from "rxjs/operators";
|
||||
import {combineLatest, Observable, Subscription} from "rxjs";
|
||||
import {Book, ReadStatus} from "../../model/book.model";
|
||||
import {Book, BookType, ReadStatus} from "../../model/book.model";
|
||||
import {BookService} from "../../service/book.service";
|
||||
import {BookMetadataManageService} from "../../service/book-metadata-manage.service";
|
||||
import {BookCardComponent} from "../book-browser/book-card/book-card.component";
|
||||
@@ -13,6 +13,7 @@ import {Tab, TabList, TabPanel, TabPanels, Tabs} from "primeng/tabs";
|
||||
import {Tag} from "primeng/tag";
|
||||
import {VirtualScrollerModule} from "@iharbeck/ngx-virtual-scroller";
|
||||
import {ProgressSpinner} from "primeng/progressspinner";
|
||||
import {ProgressBar} from "primeng/progressbar";
|
||||
import {DynamicDialogRef} from "primeng/dynamicdialog";
|
||||
import {ConfirmationService, MenuItem, MessageService} from "primeng/api";
|
||||
import {UserService} from "../../../settings/user-management/user.service";
|
||||
@@ -26,9 +27,41 @@ import {AppSettingsService} from "../../../../shared/service/app-settings.servic
|
||||
import {TranslocoDirective, TranslocoService} from '@jsverse/transloco';
|
||||
import {Tooltip} from "primeng/tooltip";
|
||||
import {Divider} from "primeng/divider";
|
||||
import {TagComponent} from "../../../../shared/components/tag/tag.component";
|
||||
import {animate, style, transition, trigger} from "@angular/animations";
|
||||
import {AfterViewChecked, Component, ElementRef, inject, OnDestroy, ViewChild} from '@angular/core';
|
||||
import {BookCardOverlayPreferenceService} from '../book-browser/book-card-overlay-preference.service';
|
||||
import {UrlHelperService} from '../../../../shared/service/url-helper.service';
|
||||
|
||||
interface ReadStatusSegment {
|
||||
status: ReadStatus;
|
||||
count: number;
|
||||
percent: number;
|
||||
}
|
||||
|
||||
interface SeriesCompletion {
|
||||
owned: number;
|
||||
total: number;
|
||||
percent: number;
|
||||
missingNumbers: number[];
|
||||
}
|
||||
|
||||
interface NextUpBook {
|
||||
book: Book;
|
||||
thumbnailUrl: string;
|
||||
isReading: boolean;
|
||||
progressPercent: number | null;
|
||||
}
|
||||
|
||||
interface SeriesStats {
|
||||
totalPages: number;
|
||||
avgPersonalRating: number | null;
|
||||
avgGoodreads: number | null;
|
||||
avgAmazon: number | null;
|
||||
avgHardcover: number | null;
|
||||
formatCounts: Map<BookType, number>;
|
||||
totalAudioDurationSeconds: number;
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: "app-series-page",
|
||||
@@ -37,12 +70,15 @@ import {BookCardOverlayPreferenceService} from '../book-browser/book-card-overla
|
||||
styleUrls: ["./series-page.component.scss"],
|
||||
imports: [
|
||||
AsyncPipe,
|
||||
DecimalPipe,
|
||||
KeyValuePipe,
|
||||
Button,
|
||||
FormsModule,
|
||||
NgStyle,
|
||||
NgClass,
|
||||
BookCardComponent,
|
||||
ProgressSpinner,
|
||||
ProgressBar,
|
||||
Tabs,
|
||||
TabList,
|
||||
Tab,
|
||||
@@ -53,7 +89,8 @@ import {BookCardOverlayPreferenceService} from '../book-browser/book-card-overla
|
||||
TieredMenu,
|
||||
Tooltip,
|
||||
Divider,
|
||||
TranslocoDirective
|
||||
TranslocoDirective,
|
||||
TagComponent
|
||||
],
|
||||
animations: [
|
||||
trigger('slideInOut', [
|
||||
@@ -87,6 +124,7 @@ export class SeriesPageComponent implements OnDestroy, AfterViewChecked {
|
||||
protected bookCardOverlayPreferenceService = inject(BookCardOverlayPreferenceService);
|
||||
protected appSettingsService = inject(AppSettingsService);
|
||||
private readonly t = inject(TranslocoService);
|
||||
protected urlHelper = inject(UrlHelperService);
|
||||
|
||||
@ViewChild('descriptionContent') descriptionContentRef?: ElementRef<HTMLElement>;
|
||||
tab: string = "view";
|
||||
@@ -130,6 +168,10 @@ export class SeriesPageComponent implements OnDestroy, AfterViewChecked {
|
||||
tap(books => this.currentBooks = books)
|
||||
);
|
||||
|
||||
coverBook$: Observable<Book | null> = this.filteredBooks$.pipe(
|
||||
map(books => books[0] ?? null)
|
||||
);
|
||||
|
||||
seriesTitle$: Observable<string> = combineLatest([
|
||||
this.seriesParam$,
|
||||
this.filteredBooks$,
|
||||
@@ -177,13 +219,11 @@ export class SeriesPageComponent implements OnDestroy, AfterViewChecked {
|
||||
const allRead = statuses.every((s) => s === ReadStatus.READ);
|
||||
if (allRead) return ReadStatus.READ;
|
||||
|
||||
// If any book is currently being read, surface series status as READING
|
||||
const isAnyReading = statuses.some(
|
||||
(s) => s === ReadStatus.READING || s === ReadStatus.RE_READING || s === ReadStatus.PAUSED
|
||||
);
|
||||
if (isAnyReading) return ReadStatus.READING;
|
||||
|
||||
// If some are read and some are unread, surface as PARTIALLY_READ
|
||||
const someRead = statuses.some((s) => s === ReadStatus.READ);
|
||||
if (someRead) return ReadStatus.PARTIALLY_READ;
|
||||
|
||||
@@ -194,7 +234,6 @@ export class SeriesPageComponent implements OnDestroy, AfterViewChecked {
|
||||
})
|
||||
);
|
||||
|
||||
// Progress like "12/20" (read/total)
|
||||
seriesReadProgress$: Observable<string> = this.filteredBooks$.pipe(
|
||||
map((books) => {
|
||||
const total = books?.length ?? 0;
|
||||
@@ -203,6 +242,175 @@ export class SeriesPageComponent implements OnDestroy, AfterViewChecked {
|
||||
})
|
||||
);
|
||||
|
||||
// Aggregated metadata across all books
|
||||
allAuthors$: Observable<string[]> = this.filteredBooks$.pipe(
|
||||
map(books => {
|
||||
const set = new Set<string>();
|
||||
for (const book of books) {
|
||||
book.metadata?.authors?.forEach(a => set.add(a));
|
||||
}
|
||||
return Array.from(set);
|
||||
})
|
||||
);
|
||||
|
||||
allCategories$: Observable<string[]> = this.filteredBooks$.pipe(
|
||||
map(books => {
|
||||
const set = new Set<string>();
|
||||
for (const book of books) {
|
||||
book.metadata?.categories?.forEach(c => set.add(c));
|
||||
}
|
||||
return Array.from(set);
|
||||
})
|
||||
);
|
||||
|
||||
allPublishers$: Observable<string[]> = this.filteredBooks$.pipe(
|
||||
map(books => {
|
||||
const set = new Set<string>();
|
||||
for (const book of books) {
|
||||
if (book.metadata?.publisher) set.add(book.metadata.publisher);
|
||||
}
|
||||
return Array.from(set);
|
||||
})
|
||||
);
|
||||
|
||||
allLanguages$: Observable<string[]> = this.filteredBooks$.pipe(
|
||||
map(books => {
|
||||
const set = new Set<string>();
|
||||
for (const book of books) {
|
||||
if (book.metadata?.language) set.add(book.metadata.language);
|
||||
}
|
||||
return Array.from(set);
|
||||
})
|
||||
);
|
||||
|
||||
// Series completion tracker
|
||||
seriesCompletion$: Observable<SeriesCompletion | null> = this.filteredBooks$.pipe(
|
||||
map(books => {
|
||||
const totals = books
|
||||
.map(b => b.metadata?.seriesTotal)
|
||||
.filter((t): t is number => t != null && t > 0);
|
||||
if (totals.length === 0) return null;
|
||||
|
||||
const seriesTotal = Math.max(...totals);
|
||||
const ownedNumbers = new Set(
|
||||
books
|
||||
.map(b => b.metadata?.seriesNumber)
|
||||
.filter((n): n is number => n != null)
|
||||
);
|
||||
|
||||
const missingNumbers: number[] = [];
|
||||
for (let i = 1; i <= seriesTotal; i++) {
|
||||
if (!ownedNumbers.has(i)) missingNumbers.push(i);
|
||||
}
|
||||
|
||||
const owned = ownedNumbers.size;
|
||||
return {
|
||||
owned,
|
||||
total: seriesTotal,
|
||||
percent: seriesTotal > 0 ? Math.round((owned / seriesTotal) * 100) : 0,
|
||||
missingNumbers
|
||||
};
|
||||
})
|
||||
);
|
||||
|
||||
// Reading progress breakdown
|
||||
readStatusBreakdown$: Observable<ReadStatusSegment[]> = this.filteredBooks$.pipe(
|
||||
map(books => {
|
||||
if (!books.length) return [];
|
||||
const counts = new Map<ReadStatus, number>();
|
||||
for (const book of books) {
|
||||
const status = (book.readStatus as ReadStatus) ?? ReadStatus.UNREAD;
|
||||
counts.set(status, (counts.get(status) || 0) + 1);
|
||||
}
|
||||
const total = books.length;
|
||||
const segments: ReadStatusSegment[] = [];
|
||||
for (const [status, count] of counts) {
|
||||
segments.push({status, count, percent: (count / total) * 100});
|
||||
}
|
||||
return segments;
|
||||
})
|
||||
);
|
||||
|
||||
// Next up / continue reading
|
||||
nextUp$: Observable<NextUpBook | null> = this.filteredBooks$.pipe(
|
||||
map(books => {
|
||||
const reading = books.find(b =>
|
||||
b.readStatus === ReadStatus.READING ||
|
||||
b.readStatus === ReadStatus.RE_READING ||
|
||||
b.readStatus === ReadStatus.PAUSED
|
||||
);
|
||||
const target = reading || books.find(b => b.readStatus === ReadStatus.UNREAD || !b.readStatus);
|
||||
if (!target) return null;
|
||||
|
||||
const isAudiobook = target.primaryFile?.bookType === 'AUDIOBOOK';
|
||||
const thumbnailUrl = isAudiobook
|
||||
? this.urlHelper.getAudiobookThumbnailUrl(target.id, target.metadata?.audiobookCoverUpdatedOn)
|
||||
: this.urlHelper.getThumbnailUrl(target.id, target.metadata?.coverUpdatedOn);
|
||||
|
||||
const isReading = target.readStatus === ReadStatus.READING ||
|
||||
target.readStatus === ReadStatus.RE_READING ||
|
||||
target.readStatus === ReadStatus.PAUSED;
|
||||
|
||||
let progressPercent: number | null = null;
|
||||
if (isReading) {
|
||||
progressPercent = target.epubProgress?.percentage
|
||||
?? target.pdfProgress?.percentage
|
||||
?? target.cbxProgress?.percentage
|
||||
?? target.audiobookProgress?.percentage
|
||||
?? target.koreaderProgress?.percentage
|
||||
?? target.koboProgress?.percentage
|
||||
?? null;
|
||||
if (progressPercent != null) {
|
||||
progressPercent = Math.round(progressPercent);
|
||||
}
|
||||
}
|
||||
|
||||
return {book: target, thumbnailUrl, isReading, progressPercent};
|
||||
})
|
||||
);
|
||||
|
||||
// Series statistics
|
||||
seriesStats$: Observable<SeriesStats> = this.filteredBooks$.pipe(
|
||||
map(books => {
|
||||
let totalPages = 0;
|
||||
const personalRatings: number[] = [];
|
||||
const goodreadsRatings: number[] = [];
|
||||
const amazonRatings: number[] = [];
|
||||
const hardcoverRatings: number[] = [];
|
||||
const formatCounts = new Map<BookType, number>();
|
||||
let totalAudioDurationSeconds = 0;
|
||||
|
||||
for (const book of books) {
|
||||
if (book.metadata?.pageCount) totalPages += book.metadata.pageCount;
|
||||
if (book.personalRating != null) personalRatings.push(book.personalRating);
|
||||
if (book.metadata?.goodreadsRating != null) goodreadsRatings.push(book.metadata.goodreadsRating);
|
||||
if (book.metadata?.amazonRating != null) amazonRatings.push(book.metadata.amazonRating);
|
||||
if (book.metadata?.hardcoverRating != null) hardcoverRatings.push(book.metadata.hardcoverRating);
|
||||
|
||||
const bookType = book.primaryFile?.bookType;
|
||||
if (bookType) {
|
||||
formatCounts.set(bookType, (formatCounts.get(bookType) || 0) + 1);
|
||||
}
|
||||
|
||||
if (book.metadata?.audiobookMetadata?.durationSeconds) {
|
||||
totalAudioDurationSeconds += book.metadata.audiobookMetadata.durationSeconds;
|
||||
}
|
||||
}
|
||||
|
||||
const avg = (arr: number[]) => arr.length > 0 ? arr.reduce((a, b) => a + b, 0) / arr.length : null;
|
||||
|
||||
return {
|
||||
totalPages,
|
||||
avgPersonalRating: avg(personalRatings),
|
||||
avgGoodreads: avg(goodreadsRatings),
|
||||
avgAmazon: avg(amazonRatings),
|
||||
avgHardcover: avg(hardcoverRatings),
|
||||
formatCounts,
|
||||
totalAudioDurationSeconds
|
||||
};
|
||||
})
|
||||
);
|
||||
|
||||
constructor() {
|
||||
this.userSub = this.userService.userState$.pipe(filter(u => !!u?.user && u.loaded))
|
||||
.subscribe(userState => {
|
||||
@@ -305,42 +513,84 @@ export class SeriesPageComponent implements OnDestroy, AfterViewChecked {
|
||||
}
|
||||
}
|
||||
|
||||
getStatusSeverityClass(status: string): string {
|
||||
const normalized = status?.toUpperCase();
|
||||
getStatusColor(status: string | ReadStatus | null | undefined): string {
|
||||
const normalized = (status ?? '').toString().toUpperCase();
|
||||
switch (normalized) {
|
||||
case "UNREAD":
|
||||
return "bg-gray-500";
|
||||
return "#6b7280";
|
||||
case "READING":
|
||||
return "bg-blue-600";
|
||||
return "#2563eb";
|
||||
case "READ":
|
||||
return "bg-green-600";
|
||||
return "#16a34a";
|
||||
case "PARTIALLY_READ":
|
||||
return "bg-yellow-600";
|
||||
return "#ca8a04";
|
||||
case "PAUSED":
|
||||
return "bg-slate-600";
|
||||
return "#475569";
|
||||
case "RE-READING":
|
||||
case "RE_READING":
|
||||
return "bg-purple-600";
|
||||
return "#9333ea";
|
||||
case "ABANDONED":
|
||||
return "bg-red-600";
|
||||
return "#dc2626";
|
||||
case "WONT_READ":
|
||||
return "bg-pink-700";
|
||||
return "#be185d";
|
||||
default:
|
||||
return "bg-gray-600";
|
||||
return "#4b5563";
|
||||
}
|
||||
}
|
||||
|
||||
getBookThumbnailUrl(book: Book): string {
|
||||
const isAudiobook = book.primaryFile?.bookType === 'AUDIOBOOK';
|
||||
return isAudiobook
|
||||
? this.urlHelper.getAudiobookThumbnailUrl(book.id, book.metadata?.audiobookCoverUpdatedOn)
|
||||
: this.urlHelper.getThumbnailUrl(book.id, book.metadata?.coverUpdatedOn);
|
||||
}
|
||||
|
||||
readBook(bookId: number): void {
|
||||
this.bookService.readBook(bookId);
|
||||
}
|
||||
|
||||
viewBookDetails(bookId: number): void {
|
||||
this.router.navigate(['/book', bookId], {
|
||||
queryParams: {tab: 'view'}
|
||||
});
|
||||
}
|
||||
|
||||
getBookProgress(book: Book): number | null {
|
||||
const progress = book.epubProgress?.percentage
|
||||
?? book.pdfProgress?.percentage
|
||||
?? book.cbxProgress?.percentage
|
||||
?? book.audiobookProgress?.percentage
|
||||
?? book.koreaderProgress?.percentage
|
||||
?? book.koboProgress?.percentage;
|
||||
if (progress == null || progress <= 0) return null;
|
||||
const pct = progress > 1 ? progress : Math.round(progress * 100);
|
||||
return Math.min(Math.round(pct), 100);
|
||||
}
|
||||
|
||||
formatDuration(totalSeconds: number): string {
|
||||
if (!totalSeconds || !isFinite(totalSeconds)) return '0:00';
|
||||
const h = Math.floor(totalSeconds / 3600);
|
||||
const m = Math.floor((totalSeconds % 3600) / 60);
|
||||
if (h > 0) {
|
||||
return `${h}h ${m}m`;
|
||||
}
|
||||
return `${m}m`;
|
||||
}
|
||||
|
||||
getRatingPercent(rating: number | null | undefined): number {
|
||||
if (rating == null) return 0;
|
||||
return Math.round((rating / 5) * 100);
|
||||
}
|
||||
|
||||
handleBookSelection(book: Book, selected: boolean) {
|
||||
if (selected) {
|
||||
if (book.seriesBooks) {
|
||||
//it is a series
|
||||
this.selectedBooks = new Set([...this.selectedBooks, ...book.seriesBooks.map(book => book.id)]);
|
||||
} else {
|
||||
this.selectedBooks.add(book.id);
|
||||
}
|
||||
} else {
|
||||
if (book.seriesBooks) {
|
||||
//it is a series
|
||||
book.seriesBooks.forEach(book => {
|
||||
this.selectedBooks.delete(book.id);
|
||||
});
|
||||
|
||||
@@ -739,17 +739,41 @@
|
||||
},
|
||||
"seriesPage": {
|
||||
"seriesDetailsTab": "Series Details",
|
||||
"bookListTab": "Book List",
|
||||
"publisher": "Publisher:",
|
||||
"years": "Years:",
|
||||
"numberOfBooks": "Number of books:",
|
||||
"book": "Book",
|
||||
"books": "Books",
|
||||
"synopsis": "Synopsis",
|
||||
"language": "Language:",
|
||||
"readStatus": "Read Status:",
|
||||
"noDescription": "No description available.",
|
||||
"showLess": "Show less",
|
||||
"showMore": "Show more",
|
||||
"noBooksFound": "No books found for this series.",
|
||||
"booksInSeries": "Books in Series",
|
||||
"selected": "selected",
|
||||
"loadingSeriesDetails": "Loading series details...",
|
||||
"completionOwned": "You own {{ owned }} of {{ total }} books",
|
||||
"missingBooks": "Missing: #{{ numbers }}",
|
||||
"nextUp": "Next Up",
|
||||
"continueReading": "Continue Reading",
|
||||
"readButton": "Read",
|
||||
"viewDetails": "View Details",
|
||||
"continueButton": "Continue",
|
||||
"readPercent": "{{ progress }} read",
|
||||
"listPages": "pages",
|
||||
"stats": {
|
||||
"totalPages": "Total Pages",
|
||||
"avgPersonalRating": "Avg. Personal Rating",
|
||||
"avgGoodreads": "Avg. Goodreads",
|
||||
"avgAmazon": "Avg. Amazon",
|
||||
"avgHardcover": "Avg. Hardcover",
|
||||
"formats": "Formats",
|
||||
"totalAudioDuration": "Audio Duration",
|
||||
"owned": "Owned"
|
||||
},
|
||||
"status": {
|
||||
"unread": "UNREAD",
|
||||
"reading": "READING",
|
||||
|
||||
@@ -739,17 +739,41 @@
|
||||
},
|
||||
"seriesPage": {
|
||||
"seriesDetailsTab": "Detalles de la serie",
|
||||
"bookListTab": "Lista de libros",
|
||||
"publisher": "Editorial:",
|
||||
"years": "Años:",
|
||||
"numberOfBooks": "Número de libros:",
|
||||
"book": "Libro",
|
||||
"books": "Libros",
|
||||
"synopsis": "Sinopsis",
|
||||
"language": "Idioma:",
|
||||
"readStatus": "Estado de lectura:",
|
||||
"noDescription": "No hay descripción disponible.",
|
||||
"showLess": "Mostrar menos",
|
||||
"showMore": "Mostrar más",
|
||||
"noBooksFound": "No se encontraron libros para esta serie.",
|
||||
"booksInSeries": "Libros en la serie",
|
||||
"selected": "seleccionados",
|
||||
"loadingSeriesDetails": "Cargando detalles de la serie...",
|
||||
"completionOwned": "Tienes {{ owned }} de {{ total }} libros",
|
||||
"missingBooks": "Faltan: #{{ numbers }}",
|
||||
"nextUp": "Siguiente",
|
||||
"continueReading": "Continuar leyendo",
|
||||
"readButton": "Leer",
|
||||
"viewDetails": "Ver detalles",
|
||||
"continueButton": "Continuar",
|
||||
"readPercent": "{{ progress }} leídos",
|
||||
"listPages": "páginas",
|
||||
"stats": {
|
||||
"totalPages": "Páginas totales",
|
||||
"avgPersonalRating": "Calif. personal prom.",
|
||||
"avgGoodreads": "Prom. Goodreads",
|
||||
"avgAmazon": "Prom. Amazon",
|
||||
"avgHardcover": "Prom. Hardcover",
|
||||
"formats": "Formatos",
|
||||
"totalAudioDuration": "Duración de audio",
|
||||
"owned": "Propios"
|
||||
},
|
||||
"status": {
|
||||
"unread": "NO LEÍDO",
|
||||
"reading": "LEYENDO",
|
||||
|
||||
Reference in New Issue
Block a user