refactor(frontend): rename booklore-ui to frontend
- Frontend path: - rename the tracked Angular app tree from `booklore-ui/` to `frontend/` - preserve file contents during the move so this commit stays focused on the path change itself - Frontend docs: - update the moved frontend README and contribution guide where they refer to the renamed folder - keep those edits limited to path references introduced by the directory rename
This commit is contained in:
+453
@@ -0,0 +1,453 @@
|
||||
<ng-container *transloco="let t; prefix: 'metadata.tabs'">
|
||||
<p-tabs lazy class="custom-p-tabs" [value]="defaultTabValue" scrollable (valueChange)="onTabChange($event)">
|
||||
<p-tablist>
|
||||
@if (bookInSeries.length > 1) {
|
||||
<p-tab value="series">
|
||||
<i class="pi pi-ethereum"></i> {{ t('moreInSeries') }}
|
||||
</p-tab>
|
||||
}
|
||||
<p-tab value="similar">
|
||||
<i class="pi pi-bookmark"></i> {{ t('similarBooks') }}
|
||||
</p-tab>
|
||||
@if (supportsDualCovers()) {
|
||||
<p-tab value="covers">
|
||||
<i class="pi pi-images"></i> {{ t('covers') }}
|
||||
</p-tab>
|
||||
}
|
||||
@if (hasAudiobookFormat()) {
|
||||
<p-tab value="chapters">
|
||||
<i class="pi pi-headphones"></i> {{ t('chapters') }}
|
||||
</p-tab>
|
||||
}
|
||||
<p-tab value="files">
|
||||
<i class="pi pi-folder-open"></i> {{ t('files') }}
|
||||
</p-tab>
|
||||
<p-tab value="notes">
|
||||
<i class="pi pi-pen-to-square"></i> {{ t('notes') }}
|
||||
</p-tab>
|
||||
<p-tab value="sessions">
|
||||
<i class="pi pi-clock"></i> {{ t('readingSessions') }}
|
||||
</p-tab>
|
||||
<p-tab value="reviews">
|
||||
<i class="pi pi-comments"></i> {{ t('reviews') }}
|
||||
</p-tab>
|
||||
</p-tablist>
|
||||
<p-tabpanels>
|
||||
<p-tabpanel value="series">
|
||||
<ng-template #content>
|
||||
<div class="tab-content">
|
||||
@if (bookInSeries.length > 1) {
|
||||
<div class="dashboard-scroller-infinite" infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50" [horizontal]="true">
|
||||
@for (bookInSeriesItem of bookInSeries; track bookInSeriesItem) {
|
||||
@if (bookInSeriesItem.id !== book.id) {
|
||||
<div class="dashboard-scroller-card">
|
||||
<app-book-card-lite-component [book]="bookInSeriesItem" [showSeriesNumber]="true" [isActive]="bookInSeriesItem.id === book.id"></app-book-card-lite-component>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</ng-template>
|
||||
</p-tabpanel>
|
||||
<p-tabpanel value="similar">
|
||||
<ng-template #content>
|
||||
<div class="tab-content">
|
||||
@if (recommendedBooks.length > 0) {
|
||||
<div class="dashboard-scroller-infinite" infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50" [horizontal]="true">
|
||||
@for (recBook of recommendedBooks; track recBook.book.id) {
|
||||
<div class="dashboard-scroller-card">
|
||||
<app-book-card-lite-component [book]="recBook.book"></app-book-card-lite-component>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</ng-template>
|
||||
</p-tabpanel>
|
||||
<p-tabpanel value="covers">
|
||||
<ng-template #content>
|
||||
<div class="covers-tab-content">
|
||||
<div class="covers-grid">
|
||||
<div class="cover-item">
|
||||
<div class="cover-label">
|
||||
<i class="pi pi-book"></i> {{ t('ebookCover') }}
|
||||
</div>
|
||||
<p-image
|
||||
[src]="urlHelper.getCoverUrl(book.id, book.metadata?.coverUpdatedOn)"
|
||||
[alt]="t('ebookCover')"
|
||||
width="200"
|
||||
appendTo="body"
|
||||
[preview]="true">
|
||||
</p-image>
|
||||
</div>
|
||||
<div class="cover-item">
|
||||
<div class="cover-label audiobook">
|
||||
<i class="pi pi-headphones"></i> {{ t('audiobookCover') }}
|
||||
</div>
|
||||
<p-image
|
||||
[src]="urlHelper.getAudiobookCoverUrl(book.id, book.metadata?.audiobookCoverUpdatedOn)"
|
||||
[alt]="t('audiobookCover')"
|
||||
width="200"
|
||||
appendTo="body"
|
||||
[preview]="true"
|
||||
class="square-cover">
|
||||
</p-image>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
</p-tabpanel>
|
||||
<p-tabpanel value="notes">
|
||||
<ng-template #content>
|
||||
<app-book-notes-component [bookId]="book.id"></app-book-notes-component>
|
||||
</ng-template>
|
||||
</p-tabpanel>
|
||||
<p-tabpanel value="sessions">
|
||||
<ng-template #content>
|
||||
<app-book-reading-sessions [bookId]="book.id"></app-book-reading-sessions>
|
||||
</ng-template>
|
||||
</p-tabpanel>
|
||||
<p-tabpanel value="reviews">
|
||||
<ng-template #content>
|
||||
<app-book-reviews [bookId]="book.id"></app-book-reviews>
|
||||
</ng-template>
|
||||
</p-tabpanel>
|
||||
<p-tabpanel value="chapters">
|
||||
<ng-template #content>
|
||||
<div class="chapters-tab-content">
|
||||
@if (chaptersLoading) {
|
||||
<div class="chapters-loading">
|
||||
<i class="pi pi-spin pi-spinner"></i>
|
||||
</div>
|
||||
} @else if (audiobookInfo) {
|
||||
<div class="chapters-tech-info">
|
||||
<span class="tech-info-item">
|
||||
<i class="pi pi-clock"></i> {{ formatDuration(audiobookInfo.durationMs) }}
|
||||
</span>
|
||||
@if (audiobookInfo.codec) {
|
||||
<span class="tech-info-item">{{ audiobookInfo.codec.toUpperCase() }}</span>
|
||||
}
|
||||
@if (audiobookInfo.bitrate) {
|
||||
<span class="tech-info-item">{{ audiobookInfo.bitrate }} kbps</span>
|
||||
}
|
||||
@if (audiobookInfo.sampleRate) {
|
||||
<span class="tech-info-item">{{ formatSampleRate(audiobookInfo.sampleRate) }}</span>
|
||||
}
|
||||
@if (audiobookInfo.channels) {
|
||||
<span class="tech-info-item">{{ getChannelLabel(audiobookInfo.channels) }}</span>
|
||||
}
|
||||
</div>
|
||||
@if (audiobookInfo.folderBased && audiobookInfo.tracks?.length) {
|
||||
<div class="chapters-table-wrapper">
|
||||
<table class="chapters-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="chapter-num">#</th>
|
||||
<th class="chapter-title">{{ t('chapterTitle') }}</th>
|
||||
<th class="chapter-file">{{ t('fileName') }}</th>
|
||||
<th class="chapter-time">{{ t('startTime') }}</th>
|
||||
<th class="chapter-time">{{ t('duration') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@for (track of audiobookInfo.tracks; track track.index) {
|
||||
<tr>
|
||||
<td class="chapter-num">{{ track.index + 1 }}</td>
|
||||
<td class="chapter-title">{{ track.title }}</td>
|
||||
<td class="chapter-file">{{ track.fileName }}</td>
|
||||
<td class="chapter-time">{{ formatDuration(track.cumulativeStartMs) }}</td>
|
||||
<td class="chapter-time">{{ formatDuration(track.durationMs) }}</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
} @else if (audiobookInfo.chapters?.length) {
|
||||
<div class="chapters-table-wrapper">
|
||||
<table class="chapters-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="chapter-num">#</th>
|
||||
<th class="chapter-title">{{ t('chapterTitle') }}</th>
|
||||
<th class="chapter-time">{{ t('startTime') }}</th>
|
||||
<th class="chapter-time">{{ t('endTime') }}</th>
|
||||
<th class="chapter-time">{{ t('duration') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@for (chapter of audiobookInfo.chapters; track chapter.index) {
|
||||
<tr>
|
||||
<td class="chapter-num">{{ chapter.index + 1 }}</td>
|
||||
<td class="chapter-title">{{ chapter.title }}</td>
|
||||
<td class="chapter-time">{{ formatDuration(chapter.startTimeMs) }}</td>
|
||||
<td class="chapter-time">{{ formatDuration(chapter.endTimeMs) }}</td>
|
||||
<td class="chapter-time">{{ formatDuration(chapter.durationMs) }}</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
} @else {
|
||||
<div class="chapters-empty">
|
||||
<i class="pi pi-info-circle"></i> {{ t('noChapters') }}
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</ng-template>
|
||||
</p-tabpanel>
|
||||
<p-tabpanel value="files">
|
||||
<ng-template #content>
|
||||
<div class="files-tab-content">
|
||||
@if (isPhysicalBook()) {
|
||||
<div class="empty-state">
|
||||
<i class="pi pi-book empty-state-icon"></i>
|
||||
<h4 class="empty-state-title">{{ t('physicalBookTitle') }}</h4>
|
||||
<p class="empty-state-message">{{ t('physicalBookMessage') }}</p>
|
||||
<p class="empty-state-hint">{{ t('physicalBookHint') }}</p>
|
||||
</div>
|
||||
} @else {
|
||||
@if (hasMultipleFiles(book)) {
|
||||
<div class="files-section download-all-section">
|
||||
<p-button
|
||||
[label]="t('downloadAll', { count: getTotalFileCount(book) })"
|
||||
icon="pi pi-download"
|
||||
severity="info"
|
||||
outlined
|
||||
(onClick)="downloadAll(book)"
|
||||
[pTooltip]="t('downloadAllTooltip')"
|
||||
tooltipPosition="top">
|
||||
</p-button>
|
||||
</div>
|
||||
}
|
||||
@if (book.primaryFile) {
|
||||
<div class="files-section">
|
||||
<h4 class="files-section-title">{{ t('primaryFile') }}</h4>
|
||||
<div class="files-list">
|
||||
<div class="file-item primary-file">
|
||||
<div class="file-info">
|
||||
<span class="file-type-badge" [style.background-color]="getFileTypeBgColor(book.primaryFile.extension)">
|
||||
{{ book.primaryFile.extension | uppercase }}
|
||||
</span>
|
||||
<span class="file-name" [pTooltip]="book.primaryFile.filePath" tooltipPosition="top">{{ book.primaryFile.fileName }}</span>
|
||||
<span class="file-size">{{ getFileSizeInMB(book.primaryFile) }}</span>
|
||||
</div>
|
||||
<div class="file-actions">
|
||||
@if (book.primaryFile.bookType === 'EPUB') {
|
||||
<p-button
|
||||
icon="pi pi-book"
|
||||
size="small"
|
||||
text
|
||||
severity="primary"
|
||||
[pTooltip]="t('readTooltip')"
|
||||
tooltipPosition="top"
|
||||
(onClick)="read(book.id)">
|
||||
</p-button>
|
||||
<p-button
|
||||
icon="pi pi-play"
|
||||
size="small"
|
||||
text
|
||||
severity="info"
|
||||
[pTooltip]="t('streamingReaderTooltip')"
|
||||
tooltipPosition="top"
|
||||
(onClick)="read(book.id, 'epub-streaming')">
|
||||
</p-button>
|
||||
} @else if (book.primaryFile.bookType && ['PDF', 'FB2', 'MOBI', 'AZW3', 'CBX'].includes(book.primaryFile.bookType)) {
|
||||
<p-button
|
||||
icon="pi pi-book"
|
||||
size="small"
|
||||
text
|
||||
severity="primary"
|
||||
[pTooltip]="t('readTooltip')"
|
||||
tooltipPosition="top"
|
||||
(onClick)="read(book.id)">
|
||||
</p-button>
|
||||
} @else if (book.primaryFile.bookType === 'AUDIOBOOK') {
|
||||
<p-button
|
||||
icon="pi pi-play"
|
||||
size="small"
|
||||
text
|
||||
severity="primary"
|
||||
[pTooltip]="t('playTooltip')"
|
||||
tooltipPosition="top"
|
||||
(onClick)="read(book.id)">
|
||||
</p-button>
|
||||
}
|
||||
<p-button
|
||||
icon="pi pi-download"
|
||||
size="small"
|
||||
text
|
||||
severity="success"
|
||||
[pTooltip]="t('downloadTooltip')"
|
||||
tooltipPosition="top"
|
||||
(onClick)="download(book)">
|
||||
</p-button>
|
||||
@if (canDetach(book)) {
|
||||
<p-button
|
||||
icon="pi pi-external-link"
|
||||
size="small"
|
||||
text
|
||||
severity="warn"
|
||||
[pTooltip]="t('detachTooltip')"
|
||||
tooltipPosition="top"
|
||||
(onClick)="detachFile(book, book.primaryFile!.id, book.primaryFile!.fileName || 'file')">
|
||||
</p-button>
|
||||
}
|
||||
<p-button
|
||||
icon="pi pi-trash"
|
||||
size="small"
|
||||
text
|
||||
severity="danger"
|
||||
[pTooltip]="t('deleteTooltip')"
|
||||
tooltipPosition="top"
|
||||
(onClick)="deleteFile(book, book.primaryFile!.id, book.primaryFile!.fileName || 'file', true)">
|
||||
</p-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (book.alternativeFormats && book.alternativeFormats.length > 0) {
|
||||
<div class="files-section">
|
||||
<h4 class="files-section-title">{{ t('alternativeFormats') }}</h4>
|
||||
<div class="files-list">
|
||||
@for (format of book.alternativeFormats; track format.id) {
|
||||
<div class="file-item">
|
||||
<div class="file-info">
|
||||
<span class="file-type-badge" [style.background-color]="getFileTypeBgColor(format.extension)">
|
||||
{{ format.extension | uppercase }}
|
||||
</span>
|
||||
<span class="file-name" [pTooltip]="format.filePath" tooltipPosition="top">{{ format.fileName }}</span>
|
||||
<span class="file-size">{{ getFileSizeInMB(format) }}</span>
|
||||
</div>
|
||||
<div class="file-actions">
|
||||
@if (format.bookType === 'EPUB') {
|
||||
<p-button
|
||||
icon="pi pi-book"
|
||||
size="small"
|
||||
text
|
||||
severity="primary"
|
||||
[pTooltip]="t('readTooltip')"
|
||||
tooltipPosition="top"
|
||||
(onClick)="read(book.id, undefined, format.bookType)">
|
||||
</p-button>
|
||||
<p-button
|
||||
icon="pi pi-play"
|
||||
size="small"
|
||||
text
|
||||
severity="info"
|
||||
[pTooltip]="t('streamingReaderTooltip')"
|
||||
tooltipPosition="top"
|
||||
(onClick)="read(book.id, 'epub-streaming', format.bookType)">
|
||||
</p-button>
|
||||
} @else if (format.bookType && ['PDF', 'FB2', 'MOBI', 'AZW3', 'CBX'].includes(format.bookType)) {
|
||||
<p-button
|
||||
icon="pi pi-book"
|
||||
size="small"
|
||||
text
|
||||
severity="primary"
|
||||
[pTooltip]="t('readTooltip')"
|
||||
tooltipPosition="top"
|
||||
(onClick)="read(book.id, undefined, format.bookType)">
|
||||
</p-button>
|
||||
} @else if (format.bookType === 'AUDIOBOOK') {
|
||||
<p-button
|
||||
icon="pi pi-play"
|
||||
size="small"
|
||||
text
|
||||
severity="primary"
|
||||
[pTooltip]="t('playTooltip')"
|
||||
tooltipPosition="top"
|
||||
(onClick)="read(book.id, undefined, format.bookType)">
|
||||
</p-button>
|
||||
}
|
||||
<p-button
|
||||
icon="pi pi-download"
|
||||
size="small"
|
||||
text
|
||||
severity="success"
|
||||
[pTooltip]="t('downloadTooltip')"
|
||||
tooltipPosition="top"
|
||||
(onClick)="downloadAdditionalFile(book, format.id)">
|
||||
</p-button>
|
||||
@if (canDetach(book)) {
|
||||
<p-button
|
||||
icon="pi pi-external-link"
|
||||
size="small"
|
||||
text
|
||||
severity="warn"
|
||||
[pTooltip]="t('detachTooltip')"
|
||||
tooltipPosition="top"
|
||||
(onClick)="detachFile(book, format.id, format.fileName || 'file')">
|
||||
</p-button>
|
||||
}
|
||||
<p-button
|
||||
icon="pi pi-trash"
|
||||
size="small"
|
||||
text
|
||||
severity="danger"
|
||||
[pTooltip]="t('deleteTooltip')"
|
||||
tooltipPosition="top"
|
||||
(onClick)="deleteFile(book, format.id, format.fileName || 'file', false)">
|
||||
</p-button>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (book.supplementaryFiles && book.supplementaryFiles.length > 0) {
|
||||
<div class="files-section">
|
||||
<h4 class="files-section-title">{{ t('supplementaryFiles') }}</h4>
|
||||
<div class="files-list">
|
||||
@for (file of book.supplementaryFiles; track file.id) {
|
||||
<div class="file-item">
|
||||
<div class="file-info">
|
||||
<i [class]="getFileIcon(getFileExtension(file.filePath))" class="file-icon"></i>
|
||||
<span class="file-name" [pTooltip]="file.filePath" tooltipPosition="top">{{ file.fileName }}</span>
|
||||
<span class="file-size">{{ getFileSizeInMB(file) }}</span>
|
||||
</div>
|
||||
<div class="file-actions">
|
||||
<p-button
|
||||
icon="pi pi-download"
|
||||
size="small"
|
||||
text
|
||||
severity="success"
|
||||
[pTooltip]="t('downloadTooltip')"
|
||||
tooltipPosition="top"
|
||||
(onClick)="downloadAdditionalFile(book, file.id)">
|
||||
</p-button>
|
||||
@if (canDetach(book)) {
|
||||
<p-button
|
||||
icon="pi pi-external-link"
|
||||
size="small"
|
||||
text
|
||||
severity="warn"
|
||||
[pTooltip]="t('detachTooltip')"
|
||||
tooltipPosition="top"
|
||||
(onClick)="detachFile(book, file.id, file.fileName || 'file')">
|
||||
</p-button>
|
||||
}
|
||||
<p-button
|
||||
icon="pi pi-trash"
|
||||
size="small"
|
||||
text
|
||||
severity="danger"
|
||||
[pTooltip]="t('deleteTooltip')"
|
||||
tooltipPosition="top"
|
||||
(onClick)="deleteSupplementary(book.id, file.id, file.fileName || 'file')">
|
||||
</p-button>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</ng-template>
|
||||
</p-tabpanel>
|
||||
</p-tabpanels>
|
||||
</p-tabs>
|
||||
</ng-container>
|
||||
+404
@@ -0,0 +1,404 @@
|
||||
.custom-p-tabs ::ng-deep .p-tabpanels {
|
||||
padding: 0.5rem 0 0 0 !important;
|
||||
}
|
||||
|
||||
.tab-content {
|
||||
padding: 0.5rem 0;
|
||||
}
|
||||
|
||||
.dashboard-scroller-infinite {
|
||||
display: flex;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
scroll-snap-type: x mandatory;
|
||||
padding: 0.5rem;
|
||||
gap: 1rem;
|
||||
width: 100%;
|
||||
scrollbar-width: thin;
|
||||
scrollbar-color: var(--border-color) transparent;
|
||||
}
|
||||
|
||||
.dashboard-scroller-infinite::-webkit-scrollbar {
|
||||
height: 8px;
|
||||
}
|
||||
|
||||
.dashboard-scroller-infinite::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.dashboard-scroller-infinite::-webkit-scrollbar-thumb {
|
||||
background: var(--border-color);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.dashboard-scroller-infinite::-webkit-scrollbar-thumb:hover {
|
||||
background: var(--text-secondary-color);
|
||||
}
|
||||
|
||||
.dashboard-scroller-card {
|
||||
width: 115px;
|
||||
flex-basis: 115px;
|
||||
flex-shrink: 0;
|
||||
flex-grow: 0;
|
||||
scroll-snap-align: start;
|
||||
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
position: relative;
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
|
||||
.dashboard-scroller-card:hover {
|
||||
transform: translateY(-6px);
|
||||
}
|
||||
|
||||
.dashboard-scroller-card:hover::after {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.dashboard-scroller-card::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: -4px;
|
||||
left: 10%;
|
||||
right: 10%;
|
||||
height: 4px;
|
||||
background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
|
||||
border-radius: 50%;
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s ease;
|
||||
filter: blur(4px);
|
||||
}
|
||||
|
||||
// Files tab styles
|
||||
.files-tab-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1.5rem;
|
||||
padding: 0.5rem 0;
|
||||
}
|
||||
|
||||
.files-section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
|
||||
&.download-all-section {
|
||||
align-items: flex-end;
|
||||
margin-bottom: -1.5rem;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.files-section-title {
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-color);
|
||||
margin: 0;
|
||||
padding-bottom: 0.5rem;
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.files-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.file-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0.75rem;
|
||||
background: var(--card-background);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 0.5rem;
|
||||
transition: background 0.2s ease, border-color 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
background: var(--highlight-background);
|
||||
border-color: var(--primary-color);
|
||||
}
|
||||
|
||||
&.primary-file {
|
||||
border-left: 3px solid var(--primary-color);
|
||||
}
|
||||
}
|
||||
|
||||
.file-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.file-type-badge {
|
||||
padding: 0.25rem 0.5rem;
|
||||
border-radius: 0.25rem;
|
||||
font-size: 0.8rem;
|
||||
font-weight: 600;
|
||||
color: #fff;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.file-icon {
|
||||
font-size: 1.25rem;
|
||||
color: var(--text-color-secondary);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.file-name {
|
||||
font-size: 0.9rem;
|
||||
color: var(--text-color);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.file-size {
|
||||
font-size: 0.8rem;
|
||||
color: var(--text-color-secondary);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.file-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
flex-shrink: 0;
|
||||
|
||||
::ng-deep .p-button-sm {
|
||||
width: 2rem;
|
||||
height: 2rem;
|
||||
|
||||
.p-button-icon {
|
||||
font-size: 1rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Empty state for physical books
|
||||
.empty-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 3rem 1rem;
|
||||
text-align: center;
|
||||
color: var(--text-color-secondary);
|
||||
}
|
||||
|
||||
.empty-state-icon {
|
||||
font-size: 3rem;
|
||||
color: var(--book-type-physical-color);
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.empty-state-title {
|
||||
font-size: 1.25rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-color);
|
||||
margin: 0 0 0.5rem 0;
|
||||
}
|
||||
|
||||
.empty-state-message {
|
||||
font-size: 0.9rem;
|
||||
margin: 0 0 0.5rem 0;
|
||||
max-width: 400px;
|
||||
}
|
||||
|
||||
.empty-state-hint {
|
||||
font-size: 0.8rem;
|
||||
font-style: italic;
|
||||
margin: 0;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
// Chapters tab styles
|
||||
.chapters-tab-content {
|
||||
padding: 0.5rem 0;
|
||||
}
|
||||
|
||||
.chapters-loading {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 2rem;
|
||||
font-size: 1.5rem;
|
||||
color: var(--text-color-secondary);
|
||||
}
|
||||
|
||||
.chapters-tech-info {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
margin-bottom: 1rem;
|
||||
font-size: 0.8rem;
|
||||
color: var(--text-color-secondary);
|
||||
|
||||
.tech-info-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
padding: 0.25rem 0.625rem;
|
||||
background: var(--highlight-background);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 9999px;
|
||||
white-space: nowrap;
|
||||
|
||||
i {
|
||||
font-size: 0.75rem;
|
||||
color: var(--primary-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.chapters-table-wrapper {
|
||||
overflow-x: auto;
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
|
||||
.chapters-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
font-size: 0.875rem;
|
||||
|
||||
th, td {
|
||||
padding: 0.625rem 0.75rem;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
thead tr {
|
||||
background: var(--highlight-background);
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
th {
|
||||
font-weight: 600;
|
||||
color: var(--text-color-secondary);
|
||||
font-size: 0.8rem;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.025em;
|
||||
}
|
||||
|
||||
tbody tr {
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
transition: background 0.15s ease;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: var(--highlight-background);
|
||||
}
|
||||
}
|
||||
|
||||
td {
|
||||
color: var(--text-color);
|
||||
}
|
||||
|
||||
.chapter-num {
|
||||
width: 3rem;
|
||||
text-align: center;
|
||||
color: var(--text-color-secondary);
|
||||
}
|
||||
|
||||
.chapter-title {
|
||||
min-width: 10rem;
|
||||
}
|
||||
|
||||
.chapter-file {
|
||||
min-width: 8rem;
|
||||
color: var(--text-color-secondary);
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
.chapter-time {
|
||||
width: 6rem;
|
||||
font-family: monospace;
|
||||
font-size: 0.8rem;
|
||||
color: var(--text-color-secondary);
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.chapters-empty {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
padding: 2rem;
|
||||
justify-content: center;
|
||||
color: var(--text-color-secondary);
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
@media (max-width: 576px) {
|
||||
.chapters-table {
|
||||
font-size: 0.8rem;
|
||||
|
||||
th, td {
|
||||
padding: 0.5rem;
|
||||
}
|
||||
|
||||
.chapter-file {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.chapter-time {
|
||||
width: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Covers tab styles
|
||||
.covers-tab-content {
|
||||
padding: 1rem 0;
|
||||
}
|
||||
|
||||
.covers-grid {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 2rem;
|
||||
justify-content: center;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
}
|
||||
|
||||
.cover-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
|
||||
::ng-deep .square-cover img {
|
||||
aspect-ratio: 1;
|
||||
object-fit: cover;
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
.cover-label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
color: var(--primary-color);
|
||||
padding: 0.25rem 0.75rem;
|
||||
background: color-mix(in srgb, var(--primary-color) 15%, transparent);
|
||||
border-radius: 0.5rem;
|
||||
|
||||
i {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
&.audiobook {
|
||||
color: var(--purple-500);
|
||||
background: color-mix(in srgb, var(--purple-500) 15%, transparent);
|
||||
}
|
||||
}
|
||||
+252
@@ -0,0 +1,252 @@
|
||||
import {Component, EventEmitter, inject, Input, Output} from '@angular/core';
|
||||
import {UpperCasePipe} from '@angular/common';
|
||||
import {Book, BookRecommendation, BookType, FileInfo} from '../../../../../book/model/book.model';
|
||||
import {Tab, TabList, TabPanel, TabPanels, Tabs} from 'primeng/tabs';
|
||||
import {InfiniteScrollDirective} from 'ngx-infinite-scroll';
|
||||
import {BookCardLiteComponent} from '../../../../../book/components/book-card-lite/book-card-lite-component';
|
||||
import {BookReviewsComponent} from '../../../../../book/components/book-reviews/book-reviews.component';
|
||||
import {BookNotesComponent} from '../../../../../book/components/book-notes/book-notes-component';
|
||||
import {BookReadingSessionsComponent} from '../../book-reading-sessions/book-reading-sessions.component';
|
||||
import {Button} from 'primeng/button';
|
||||
import {Tooltip} from 'primeng/tooltip';
|
||||
import {Image} from 'primeng/image';
|
||||
import {UrlHelperService} from '../../../../../../shared/service/url-helper.service';
|
||||
import {BookMetadataManageService} from '../../../../../book/service/book-metadata-manage.service';
|
||||
import {TranslocoDirective, TranslocoService} from '@jsverse/transloco';
|
||||
import {AudiobookService} from '../../../../../readers/audiobook-player/audiobook.service';
|
||||
import {AudiobookInfo} from '../../../../../readers/audiobook-player/audiobook.model';
|
||||
|
||||
export interface ReadEvent {
|
||||
bookId: number;
|
||||
reader?: 'epub-streaming';
|
||||
bookType?: BookType;
|
||||
}
|
||||
|
||||
export interface DownloadEvent {
|
||||
book: Book;
|
||||
}
|
||||
|
||||
export interface DownloadAdditionalFileEvent {
|
||||
book: Book;
|
||||
fileId: number;
|
||||
}
|
||||
|
||||
export interface DownloadAllFilesEvent {
|
||||
book: Book;
|
||||
}
|
||||
|
||||
export interface DeleteBookFileEvent {
|
||||
book: Book;
|
||||
fileId: number;
|
||||
fileName: string;
|
||||
isPrimary: boolean;
|
||||
isOnlyFormat: boolean;
|
||||
}
|
||||
|
||||
export interface DeleteSupplementaryFileEvent {
|
||||
bookId: number;
|
||||
fileId: number;
|
||||
fileName: string;
|
||||
}
|
||||
|
||||
export interface DetachBookFileEvent {
|
||||
book: Book;
|
||||
fileId: number;
|
||||
fileName: string;
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'app-metadata-tabs',
|
||||
standalone: true,
|
||||
imports: [
|
||||
Tab,
|
||||
TabList,
|
||||
TabPanel,
|
||||
TabPanels,
|
||||
Tabs,
|
||||
InfiniteScrollDirective,
|
||||
BookCardLiteComponent,
|
||||
BookReviewsComponent,
|
||||
BookNotesComponent,
|
||||
BookReadingSessionsComponent,
|
||||
Button,
|
||||
Tooltip,
|
||||
UpperCasePipe,
|
||||
Image,
|
||||
TranslocoDirective
|
||||
],
|
||||
templateUrl: './metadata-tabs.component.html',
|
||||
styleUrl: './metadata-tabs.component.scss'
|
||||
})
|
||||
export class MetadataTabsComponent {
|
||||
@Input() book!: Book;
|
||||
@Input() bookInSeries: Book[] = [];
|
||||
@Input() recommendedBooks: BookRecommendation[] = [];
|
||||
|
||||
protected urlHelper = inject(UrlHelperService);
|
||||
private bookMetadataManageService = inject(BookMetadataManageService);
|
||||
private audiobookService = inject(AudiobookService);
|
||||
private t = inject(TranslocoService);
|
||||
|
||||
audiobookInfo: AudiobookInfo | null = null;
|
||||
chaptersLoading = false;
|
||||
|
||||
@Output() readBook = new EventEmitter<ReadEvent>();
|
||||
@Output() downloadBook = new EventEmitter<DownloadEvent>();
|
||||
@Output() downloadFile = new EventEmitter<DownloadAdditionalFileEvent>();
|
||||
@Output() downloadAllFiles = new EventEmitter<DownloadAllFilesEvent>();
|
||||
@Output() deleteBookFile = new EventEmitter<DeleteBookFileEvent>();
|
||||
@Output() deleteSupplementaryFile = new EventEmitter<DeleteSupplementaryFileEvent>();
|
||||
@Output() detachBookFile = new EventEmitter<DetachBookFileEvent>();
|
||||
|
||||
get defaultTabValue(): string {
|
||||
return this.bookInSeries && this.bookInSeries.length > 1 ? 'series' : 'similar';
|
||||
}
|
||||
|
||||
read(bookId: number, reader?: 'epub-streaming', bookType?: BookType): void {
|
||||
this.readBook.emit({ bookId, reader, bookType });
|
||||
}
|
||||
|
||||
download(book: Book): void {
|
||||
this.downloadBook.emit({ book });
|
||||
}
|
||||
|
||||
downloadAdditionalFile(book: Book, fileId: number): void {
|
||||
this.downloadFile.emit({ book, fileId });
|
||||
}
|
||||
|
||||
downloadAll(book: Book): void {
|
||||
this.downloadAllFiles.emit({ book });
|
||||
}
|
||||
|
||||
deleteFile(book: Book, fileId: number, fileName: string, isPrimary: boolean): void {
|
||||
const isOnlyFormat = !book.alternativeFormats?.length;
|
||||
this.deleteBookFile.emit({ book, fileId, fileName, isPrimary, isOnlyFormat });
|
||||
}
|
||||
|
||||
deleteSupplementary(bookId: number, fileId: number, fileName: string): void {
|
||||
this.deleteSupplementaryFile.emit({ bookId, fileId, fileName });
|
||||
}
|
||||
|
||||
detachFile(book: Book, fileId: number, fileName: string): void {
|
||||
this.detachBookFile.emit({ book, fileId, fileName });
|
||||
}
|
||||
|
||||
canDetach(book: Book): boolean {
|
||||
const totalFiles = (book.primaryFile ? 1 : 0)
|
||||
+ (book.alternativeFormats?.length ?? 0)
|
||||
+ (book.supplementaryFiles?.length ?? 0);
|
||||
return totalFiles > 1;
|
||||
}
|
||||
|
||||
hasMultipleFiles(book: Book): boolean {
|
||||
const primaryCount = book.primaryFile ? 1 : 0;
|
||||
const altCount = book.alternativeFormats?.length ?? 0;
|
||||
return (primaryCount + altCount) > 1;
|
||||
}
|
||||
|
||||
getTotalFileCount(book: Book): number {
|
||||
const primaryCount = book.primaryFile ? 1 : 0;
|
||||
const altCount = book.alternativeFormats?.length ?? 0;
|
||||
return primaryCount + altCount;
|
||||
}
|
||||
|
||||
getFileSizeInMB(fileInfo: FileInfo | null | undefined): string {
|
||||
const sizeKb = fileInfo?.fileSizeKb;
|
||||
return sizeKb != null ? `${(sizeKb / 1024).toFixed(2)} MB` : '-';
|
||||
}
|
||||
|
||||
getFileExtension(filePath?: string): string | null {
|
||||
if (!filePath) return null;
|
||||
const parts = filePath.split('.');
|
||||
if (parts.length < 2) return null;
|
||||
return parts.pop()?.toUpperCase() || null;
|
||||
}
|
||||
|
||||
getFileIcon(fileType: string | null): string {
|
||||
if (!fileType) return 'pi pi-file';
|
||||
switch (fileType.toLowerCase()) {
|
||||
case 'pdf':
|
||||
return 'pi pi-file-pdf';
|
||||
case 'epub':
|
||||
case 'mobi':
|
||||
case 'azw3':
|
||||
return 'pi pi-book';
|
||||
case 'cbz':
|
||||
case 'cbr':
|
||||
case 'cbx':
|
||||
return 'pi pi-image';
|
||||
case 'audiobook':
|
||||
case 'm4b':
|
||||
case 'm4a':
|
||||
case 'mp3':
|
||||
case 'opus':
|
||||
return 'pi pi-headphones';
|
||||
default:
|
||||
return 'pi pi-file';
|
||||
}
|
||||
}
|
||||
|
||||
getFileTypeBgColor(fileType: string | null | undefined): string {
|
||||
if (!fileType) return 'var(--p-gray-500)';
|
||||
const type = fileType.toLowerCase();
|
||||
return `var(--book-type-${type}-color, var(--p-gray-500))`;
|
||||
}
|
||||
|
||||
isPhysicalBook(): boolean {
|
||||
return !this.book?.primaryFile && (!this.book?.alternativeFormats || this.book.alternativeFormats.length === 0);
|
||||
}
|
||||
|
||||
supportsDualCovers(): boolean {
|
||||
return this.bookMetadataManageService.supportsDualCovers(this.book);
|
||||
}
|
||||
|
||||
onTabChange(value: string | number | undefined): void {
|
||||
if (value === 'chapters') {
|
||||
this.loadChapters();
|
||||
}
|
||||
}
|
||||
|
||||
hasAudiobookFormat(): boolean {
|
||||
const allFiles = [this.book.primaryFile, ...(this.book.alternativeFormats || [])].filter(f => f?.bookType);
|
||||
return allFiles.some(f => f!.bookType === 'AUDIOBOOK');
|
||||
}
|
||||
|
||||
loadChapters(): void {
|
||||
if (this.audiobookInfo || this.chaptersLoading) return;
|
||||
this.chaptersLoading = true;
|
||||
this.audiobookService.getAudiobookInfo(this.book.id).subscribe({
|
||||
next: info => {
|
||||
this.audiobookInfo = info;
|
||||
this.chaptersLoading = false;
|
||||
},
|
||||
error: () => {
|
||||
this.chaptersLoading = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
formatDuration(ms: number): string {
|
||||
const totalSeconds = Math.floor(ms / 1000);
|
||||
const hours = Math.floor(totalSeconds / 3600);
|
||||
const minutes = Math.floor((totalSeconds % 3600) / 60);
|
||||
const seconds = totalSeconds % 60;
|
||||
const pad = (n: number) => n.toString().padStart(2, '0');
|
||||
return hours > 0 ? `${pad(hours)}:${pad(minutes)}:${pad(seconds)}` : `${pad(minutes)}:${pad(seconds)}`;
|
||||
}
|
||||
|
||||
formatSampleRate(sampleRate: number): string {
|
||||
return `${(sampleRate / 1000).toFixed(1)} kHz`;
|
||||
}
|
||||
|
||||
getChannelLabel(channels: number): string {
|
||||
switch (channels) {
|
||||
case 1:
|
||||
return this.t.translate('metadata.viewer.channelMono');
|
||||
case 2:
|
||||
return this.t.translate('metadata.viewer.channelStereo');
|
||||
default:
|
||||
return this.t.translate('metadata.viewer.channelMultiple', { count: channels });
|
||||
}
|
||||
}
|
||||
}
|
||||
+989
@@ -0,0 +1,989 @@
|
||||
@if (book; as book) {
|
||||
<div class="metadata-viewer-container" *transloco="let t; prefix: 'metadata.viewer'">
|
||||
<div class="metadata-header">
|
||||
|
||||
<div class="cover-section">
|
||||
<div class="cover-wrapper">
|
||||
|
||||
<p-image
|
||||
[src]="getBookCoverUrl(book)"
|
||||
alt="Image"
|
||||
width="250"
|
||||
appendTo="body"
|
||||
[preview]="true">
|
||||
</p-image>
|
||||
|
||||
@if (book?.metadata!.seriesNumber != null) {
|
||||
<div class="series-badge">
|
||||
#{{ book?.metadata!.seriesNumber }}
|
||||
</div>
|
||||
}
|
||||
|
||||
<div
|
||||
class="cover-progress-bar-container"
|
||||
[style.--progress-count]="getProgressCount(book)">
|
||||
@let progress = getProgressPercent(book);
|
||||
@if (progress !== null) {
|
||||
<p-progressBar
|
||||
[value]="progress"
|
||||
[showValue]="false"
|
||||
class="cover-progress-bar"
|
||||
[ngClass]="{
|
||||
'progress-complete': progress === 100,
|
||||
'progress-incomplete': progress < 100
|
||||
}"
|
||||
></p-progressBar>
|
||||
}
|
||||
|
||||
@if (getKoProgressPercent(book) !== null) {
|
||||
<p-progressBar
|
||||
[value]="getKoProgressPercent(book)"
|
||||
[showValue]="false"
|
||||
class="cover-progress-bar"
|
||||
[ngClass]="[
|
||||
getKoProgressPercent(book) === 100 ? 'progress-complete-ko' : 'progress-incomplete-ko'
|
||||
]"
|
||||
>
|
||||
</p-progressBar>
|
||||
}
|
||||
|
||||
@if (getKoboProgressPercent(book) !== null) {
|
||||
<p-progressBar
|
||||
[value]="getKoboProgressPercent(book)"
|
||||
[showValue]="false"
|
||||
class="cover-progress-bar"
|
||||
[ngClass]="[
|
||||
getKoboProgressPercent(book) === 100 ? 'progress-complete-kobo' : 'progress-incomplete-kobo'
|
||||
]"
|
||||
>
|
||||
</p-progressBar>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (navigationState()) {
|
||||
<div class="navigation-buttons-mobile">
|
||||
<p-button
|
||||
icon="pi pi-chevron-left"
|
||||
[disabled]="!canNavigatePrevious()"
|
||||
(onClick)="navigatePrevious()"
|
||||
rounded
|
||||
outlined
|
||||
severity="info"
|
||||
[pTooltip]="t('goToPreviousBook')"
|
||||
tooltipPosition="bottom">
|
||||
</p-button>
|
||||
<span class="navigation-position">
|
||||
{{ navigationPosition() }}
|
||||
</span>
|
||||
<p-button
|
||||
icon="pi pi-chevron-right"
|
||||
iconPos="right"
|
||||
[disabled]="!canNavigateNext()"
|
||||
(onClick)="navigateNext()"
|
||||
severity="info"
|
||||
rounded
|
||||
outlined
|
||||
[pTooltip]="t('goToNextBook')"
|
||||
tooltipPosition="bottom">
|
||||
</p-button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="info-section">
|
||||
<div class="info-content">
|
||||
|
||||
<div class="title-group">
|
||||
@if (book?.metadata?.seriesName) {
|
||||
<div class="series-link" (click)="goToSeries(book?.metadata?.seriesName!)">
|
||||
{{ book?.metadata?.seriesName }}
|
||||
@if (book?.metadata?.seriesNumber) {
|
||||
#{{ book?.metadata?.seriesNumber }}
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="title-wrapper">
|
||||
<div class="title-content">
|
||||
<h1 class="book-title">
|
||||
{{ book?.metadata?.title }}@if (book?.metadata?.subtitle) {
|
||||
: {{ book.metadata?.subtitle }}
|
||||
}
|
||||
</h1>
|
||||
<i
|
||||
class="pi lock-icon"
|
||||
[ngClass]="isMetadataFullyLocked(book?.metadata!) ? 'pi-lock locked' : 'pi-lock-open unlocked'"
|
||||
[pTooltip]="isMetadataFullyLocked(book?.metadata!) ? t('metadataLocked') : t('metadataUnlocked')"
|
||||
tooltipPosition="top"
|
||||
></i>
|
||||
</div>
|
||||
|
||||
<p class="authors">
|
||||
@for (author of book?.metadata!.authors; track $index; let isLast = $last; let isFirst = $first) {
|
||||
@if (isFirst && book!.metadata!.authors!.length > 1) {
|
||||
<a class="author-link" (click)="goToAuthorBooks(author)">{{ author }}</a>
|
||||
<span class="first-author-badge">{{ t('firstAuthorBadge') }}</span>
|
||||
} @else {
|
||||
<a class="author-link" (click)="goToAuthorBooks(author)">{{ author }}</a>
|
||||
}
|
||||
@if (!isLast) {
|
||||
<span class="author-separator">, </span>
|
||||
}
|
||||
}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="formats-inline">
|
||||
@if (getDisplayFormat(book?.primaryFile); as displayFormat) {
|
||||
<span class="format-tag-wrapper primary-format" (click)="goToFileType(book?.primaryFile?.filePath)" [pTooltip]="book?.primaryFile?.fileName ?? ''" tooltipPosition="top">
|
||||
<app-tag size="3xs" variant="pill" [customBgColor]="getFileTypeBgColor(displayFormat)" customTextColor="#fff">
|
||||
{{ displayFormat }}
|
||||
</app-tag>
|
||||
<span class="format-badge">{{ t('primaryBadge') }}</span>
|
||||
</span>
|
||||
}
|
||||
@if (getDisplayFormat(book?.primaryFile) && getUniqueAlternativeFormats(book).length > 0) {
|
||||
<span class="format-pipe">|</span>
|
||||
}
|
||||
@for (formatExt of getUniqueAlternativeFormats(book); track formatExt) {
|
||||
<span class="format-tag-wrapper" (click)="goToFileType('.' + formatExt)" [pTooltip]="formatExt" tooltipPosition="top">
|
||||
<app-tag size="3xs" variant="pill" [customBgColor]="getFileTypeBgColor(formatExt)" customTextColor="#fff">
|
||||
{{ formatExt }}
|
||||
</app-tag>
|
||||
</span>
|
||||
}
|
||||
@if (book?.isPhysical) {
|
||||
<app-tag size="3xs" variant="pill" [customBgColor]="'var(--book-type-physical-color)'" customTextColor="#fff">{{ t('physicalBadge') }}</app-tag>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ratings-section">
|
||||
|
||||
<div class="personal-rating">
|
||||
<div class="rating-group">
|
||||
<i class="pi pi-thumbs-up-fill rating-icon" [pTooltip]="t('personalRating')" tooltipPosition="top"></i>
|
||||
<p-rating
|
||||
[ngModel]="book?.personalRating"
|
||||
(onRate)="onPersonalRatingChange(book, $event)"
|
||||
stars="10"
|
||||
[style.--p-rating-icon-active-color]="getStarColorScaled(book?.personalRating, 10)">
|
||||
</p-rating>
|
||||
</div>
|
||||
<p-button
|
||||
text
|
||||
size="small"
|
||||
icon="pi pi-undo"
|
||||
severity="warn"
|
||||
(onClick)="resetPersonalRating(book)"
|
||||
[pTooltip]="t('resetRating')"
|
||||
tooltipPosition="top"
|
||||
class="reset-button">
|
||||
</p-button>
|
||||
</div>
|
||||
|
||||
@if (book?.metadata?.amazonRating || book?.metadata?.asin || book?.metadata?.goodreadsRating || book?.metadata?.goodreadsId || book?.metadata?.hardcoverRating || book?.metadata?.hardcoverId || book?.metadata?.lubimyczytacRating || book?.metadata?.lubimyczytacId || book?.metadata?.ranobedbRating || book?.metadata?.ranobedbId || book?.metadata?.audibleRating || book?.metadata?.audibleId || book?.metadata?.googleId) {
|
||||
<div class="gradient-divider"></div>
|
||||
}
|
||||
|
||||
<div class="external-ratings">
|
||||
@if (book?.metadata?.amazonRating || book?.metadata?.asin) {
|
||||
<a
|
||||
class="rating-link"
|
||||
[href]="'https://www.amazon.' + amazonDomain + '/dp/' + (book.metadata?.asin ?? '')"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
[pTooltip]="book?.metadata?.amazonRating ? getRatingTooltip(book, 'amazon') : undefined"
|
||||
tooltipPosition="top"
|
||||
>
|
||||
<img src="https://www.amazon.com/favicon.ico" alt="Amazon" class="rating-favicon"/>
|
||||
@if (book?.metadata?.amazonRating) {
|
||||
<span class="rating-value">{{ getRatingPercent(book.metadata!.amazonRating) }}%</span>
|
||||
}
|
||||
</a>
|
||||
}
|
||||
|
||||
@if (book?.metadata?.goodreadsRating || book?.metadata?.goodreadsId) {
|
||||
<a
|
||||
class="rating-link"
|
||||
[href]="'https://www.goodreads.com/book/show/' + (book.metadata?.goodreadsId ?? '')"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
[pTooltip]="book?.metadata?.goodreadsRating ? getRatingTooltip(book, 'goodreads') : undefined"
|
||||
tooltipPosition="top"
|
||||
>
|
||||
<img src="https://www.goodreads.com/favicon.ico" alt="Goodreads" class="rating-favicon"/>
|
||||
@if (book?.metadata?.goodreadsRating) {
|
||||
<span class="rating-value">{{ getRatingPercent(book.metadata!.goodreadsRating) }}%</span>
|
||||
}
|
||||
</a>
|
||||
}
|
||||
|
||||
@if (book?.metadata?.hardcoverRating || book?.metadata?.hardcoverId) {
|
||||
<a
|
||||
class="rating-link"
|
||||
[href]="'https://hardcover.app/books/' + (book.metadata?.hardcoverId ?? '')"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
[pTooltip]="book?.metadata?.hardcoverRating ? getRatingTooltip(book, 'hardcover') : undefined"
|
||||
tooltipPosition="top"
|
||||
>
|
||||
<img src="https://assets.hardcover.app/static/favicon.ico" alt="Hardcover" class="rating-favicon"/>
|
||||
@if (book?.metadata?.hardcoverRating) {
|
||||
<span class="rating-value">{{ getRatingPercent(book.metadata!.hardcoverRating) }}%</span>
|
||||
}
|
||||
</a>
|
||||
}
|
||||
|
||||
@if (book?.metadata?.lubimyczytacRating || book?.metadata?.lubimyczytacId) {
|
||||
<a
|
||||
class="rating-link"
|
||||
[href]="book.metadata?.lubimyczytacId ? 'https://lubimyczytac.pl/ksiazka/' + book.metadata?.lubimyczytacId + '/ksiazka' : ''"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
[pTooltip]="book?.metadata?.lubimyczytacRating ? getRatingTooltip(book, 'lubimyczytac') : undefined"
|
||||
tooltipPosition="top"
|
||||
>
|
||||
<img src="https://lubimyczytac.pl/favicon.ico" alt="Lubimyczytac" class="rating-favicon"/>
|
||||
@if (book?.metadata?.lubimyczytacRating) {
|
||||
<span class="rating-value">{{ getRatingPercent(book.metadata!.lubimyczytacRating) }}%</span>
|
||||
}
|
||||
</a>
|
||||
}
|
||||
|
||||
@if (book?.metadata?.ranobedbRating || book?.metadata?.ranobedbId) {
|
||||
<a
|
||||
class="rating-link"
|
||||
[href]="'https://ranobedb.org/book/' + (book.metadata?.ranobedbId ?? '')"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
[pTooltip]="book?.metadata?.ranobedbRating ? getRatingTooltip(book, 'ranobedb') : undefined"
|
||||
tooltipPosition="top"
|
||||
>
|
||||
<img src="https://www.ranobedb.org/favicon.png" alt="Ranobedb" class="rating-favicon"/>
|
||||
@if (book?.metadata?.ranobedbRating) {
|
||||
<span class="rating-value">{{ getRatingPercent(book.metadata!.ranobedbRating) }}%</span>
|
||||
}
|
||||
</a>
|
||||
}
|
||||
|
||||
@if (book?.metadata?.audibleRating || book?.metadata?.audibleId) {
|
||||
<a
|
||||
class="rating-link"
|
||||
[href]="'https://www.audible.com/pd/' + (book.metadata?.audibleId ?? '')"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
[pTooltip]="book?.metadata?.audibleRating ? getRatingTooltip(book, 'audible') : undefined"
|
||||
tooltipPosition="top"
|
||||
>
|
||||
<img src="https://www.audible.com/favicon.ico" alt="Audible" class="rating-favicon"/>
|
||||
@if (book?.metadata?.audibleRating) {
|
||||
<span class="rating-value">{{ getRatingPercent(book.metadata!.audibleRating) }}%</span>
|
||||
}
|
||||
</a>
|
||||
}
|
||||
|
||||
@if (book?.metadata?.googleId) {
|
||||
<a
|
||||
class="rating-link"
|
||||
[href]="'https://books.google.com/books?id=' + book.metadata!.googleId"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<img src="https://books.google.com/favicon.ico" alt="Google Books" class="rating-favicon"/>
|
||||
</a>
|
||||
}
|
||||
|
||||
@if (book?.metadata?.comicMetadata?.webLink) {
|
||||
<a
|
||||
class="rating-link"
|
||||
[href]="book.metadata!.comicMetadata!.webLink"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<img src="https://www.comicvine.com/favicon.ico" alt="Comic Vine" class="rating-favicon"/>
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tags-section">
|
||||
@if (book?.metadata?.categories?.length) {
|
||||
<div class="tag-row">
|
||||
<span class="tag-label">{{ t('genresLabel') }}</span>
|
||||
<div class="tag-scroll">
|
||||
<div class="tag-container">
|
||||
@for (category of book.metadata!.categories; track category) {
|
||||
<a (click)="goToCategory(category)" class="tag-clickable">
|
||||
<app-tag color="red" size="xs">{{ category }}</app-tag>
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (book?.metadata?.moods?.length) {
|
||||
<div class="tag-row">
|
||||
<span class="tag-label">{{ t('moodsLabel') }}</span>
|
||||
<div class="tag-scroll">
|
||||
<div class="tag-container">
|
||||
@for (mood of book.metadata!.moods; track mood) {
|
||||
<a (click)="goToMood(mood)" class="tag-clickable">
|
||||
<app-tag color="indigo" size="xs">{{ mood }}</app-tag>
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (book?.metadata?.tags?.length) {
|
||||
<div class="tag-row">
|
||||
<span class="tag-label">{{ t('tagsLabel') }}</span>
|
||||
<div class="tag-scroll">
|
||||
<div class="tag-container">
|
||||
@for (tag of book.metadata!.tags; track tag) {
|
||||
<a (click)="goToTag(tag)" class="tag-clickable">
|
||||
<app-tag color="green" size="xs">{{ tag }}</app-tag>
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="metadata-grid">
|
||||
<div class="metadata-item">
|
||||
<span class="metadata-key">{{ t('libraryLabel') }}</span>
|
||||
@if (book?.libraryName) {
|
||||
<span class="metadata-value metadata-link" (click)="goToLibrary(book.libraryId!)">
|
||||
{{ book?.libraryName }}
|
||||
</span>
|
||||
} @else {
|
||||
<span class="metadata-value">-</span>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="metadata-item">
|
||||
<span class="metadata-key">{{ t('publisherLabel') }}</span>
|
||||
@if (book?.metadata?.publisher) {
|
||||
<span class="metadata-value metadata-link" (click)="goToPublisher(book?.metadata?.publisher!)">
|
||||
{{ book?.metadata?.publisher }}
|
||||
</span>
|
||||
} @else {
|
||||
<span class="metadata-value">-</span>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="metadata-item">
|
||||
<span class="metadata-key">{{ t('publishedLabel') }}</span>
|
||||
@if (book?.metadata!.publishedDate) {
|
||||
<span class="metadata-value metadata-link" (click)="goToPublishedYear(book?.metadata!.publishedDate!)">
|
||||
{{ book?.metadata!.publishedDate }}
|
||||
</span>
|
||||
} @else {
|
||||
<span class="metadata-value">-</span>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="metadata-item">
|
||||
<span class="metadata-key">{{ t('languageLabel') }}</span>
|
||||
@if (book?.metadata!.language) {
|
||||
<span class="metadata-value metadata-link" (click)="goToLanguage(book?.metadata!.language!)">
|
||||
{{ book?.metadata!.language }}
|
||||
</span>
|
||||
} @else {
|
||||
<span class="metadata-value">-</span>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="metadata-item">
|
||||
<span class="metadata-key">{{ t('grimmoryProgressLabel') }}</span>
|
||||
<span class="metadata-value-group">
|
||||
<app-tag size="3xs" variant="pill" [color]="getProgressColor(getProgressPercent(book))">
|
||||
{{ getProgressPercent(book) !== null ? getProgressPercent(book) + '%' : 'N/A' }}
|
||||
</app-tag>
|
||||
@if (getProgressPercent(book) !== null) {
|
||||
<p-button
|
||||
[pTooltip]="t('resetProgress')"
|
||||
tooltipPosition="bottom"
|
||||
icon="pi pi-refresh"
|
||||
size="small"
|
||||
severity="danger"
|
||||
text
|
||||
class="inline-action-button"
|
||||
(onClick)="resetProgress(book, ResetProgressTypes.GRIMMORY)">
|
||||
</p-button>
|
||||
}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="metadata-item">
|
||||
<span class="metadata-key">{{ t('metadataMatchLabel') }}</span>
|
||||
@if (book?.metadataMatchScore != null) {
|
||||
<span (click)="goToMatchScoreRange(book?.metadataMatchScore!)" style="cursor: pointer;">
|
||||
<app-tag size="3xs" variant="pill" [color]="getMatchScoreColor(book?.metadataMatchScore!)">
|
||||
{{ (book?.metadataMatchScore!) | number:'1.0-0' }}%
|
||||
</app-tag>
|
||||
</span>
|
||||
} @else {
|
||||
<span class="metadata-value">-</span>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="metadata-item">
|
||||
<span class="metadata-key">{{ t('isbnLabel') }}</span>
|
||||
@if (book?.metadata?.isbn13 || book?.metadata?.isbn10) {
|
||||
<span class="metadata-value">
|
||||
{{ book.metadata!.isbn13 }}
|
||||
@if (book?.metadata?.isbn13 && book?.metadata?.isbn10) {
|
||||
/
|
||||
}
|
||||
{{ book.metadata!.isbn10 }}
|
||||
</span>
|
||||
} @else {
|
||||
<span class="metadata-value">-</span>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="metadata-item">
|
||||
<span class="metadata-key">{{ t('readStatusLabel') }}</span>
|
||||
<span class="metadata-value-group">
|
||||
<span (click)="goToReadStatus(selectedReadStatus)" style="cursor: pointer;">
|
||||
<app-tag size="3xs" variant="pill" [color]="getStatusColor(selectedReadStatus)">
|
||||
{{ getStatusLabel(selectedReadStatus) }}
|
||||
</app-tag>
|
||||
</span>
|
||||
<i class="pi pi-pencil edit-icon" (click)="menu.toggle($event)"></i>
|
||||
<p-menu #menu [popup]="true" [model]="readStatusMenuItems"></p-menu>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@if (book?.koreaderProgress && book.koreaderProgress?.percentage != null) {
|
||||
<div class="metadata-item">
|
||||
<span class="metadata-key">{{ t('koreaderProgressLabel') }}</span>
|
||||
<span class="metadata-value-group">
|
||||
<app-tag size="3xs" variant="pill" [color]="getKoProgressColor(getKOReaderPercentage(book))">
|
||||
{{ getKOReaderPercentage(book) + '%' }}
|
||||
</app-tag>
|
||||
<p-button
|
||||
[pTooltip]="t('resetProgress')"
|
||||
tooltipPosition="bottom"
|
||||
icon="pi pi-refresh"
|
||||
size="small"
|
||||
severity="danger"
|
||||
text
|
||||
class="inline-action-button"
|
||||
(onClick)="resetProgress(book, ResetProgressTypes.KOREADER)">
|
||||
</p-button>
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (book?.koboProgress && book.koboProgress?.percentage != null) {
|
||||
<div class="metadata-item">
|
||||
<span class="metadata-key">{{ t('koboProgressLabel') }}</span>
|
||||
<span class="metadata-value-group">
|
||||
<app-tag size="3xs" variant="pill" [color]="getKoProgressColor(book.koboProgress?.percentage)">
|
||||
{{ book.koboProgress?.percentage | number:'1.0-1' }}%
|
||||
</app-tag>
|
||||
<p-button
|
||||
[pTooltip]="t('resetProgress')"
|
||||
tooltipPosition="bottom"
|
||||
icon="pi pi-refresh"
|
||||
size="small"
|
||||
severity="danger"
|
||||
text
|
||||
class="inline-action-button"
|
||||
(onClick)="resetProgress(book, ResetProgressTypes.KOBO)">
|
||||
</p-button>
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (selectedReadStatus === ReadStatus.READ) {
|
||||
<div class="metadata-item">
|
||||
@if (book?.dateFinished) {
|
||||
<span class="metadata-key">{{ t('finishedOnLabel') }}</span>
|
||||
@if (!isEditingDateFinished) {
|
||||
<span class="metadata-value-group">
|
||||
<span class="metadata-value">{{ formatDate(book.dateFinished) }}</span>
|
||||
<i class="pi pi-pencil edit-icon" (click)="toggleDateFinishedEdit(book)"></i>
|
||||
</span>
|
||||
} @else {
|
||||
<span class="metadata-value-group">
|
||||
<p-datepicker
|
||||
[(ngModel)]="editDateFinished"
|
||||
dateFormat="dd-M-yy"
|
||||
size="small"
|
||||
[showIcon]="true"
|
||||
[iconDisplay]="'input'"
|
||||
appendTo="body"
|
||||
[style]="{ 'width': '125px', 'font-size': '12px' }">
|
||||
</p-datepicker>
|
||||
<p-button rounded icon="pi pi-check" size="small" severity="success" text (onClick)="saveDateFinished(book)" [pTooltip]="t('saveDate')"></p-button>
|
||||
<p-button rounded icon="pi pi-times" size="small" severity="danger" text (onClick)="cancelDateFinishedEdit()" [pTooltip]="'common.cancel' | transloco"></p-button>
|
||||
</span>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="metadata-item">
|
||||
<span class="metadata-key">{{ t('pageCountLabel') }}</span>
|
||||
@if (book?.metadata!.pageCount) {
|
||||
<span class="metadata-value metadata-link" (click)="goToPageCountRange(book?.metadata!.pageCount!)">
|
||||
{{ book?.metadata!.pageCount }}
|
||||
</span>
|
||||
} @else {
|
||||
<span class="metadata-value">-</span>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="metadata-item">
|
||||
<span class="metadata-key">{{ t('ageRatingLabel') }}</span>
|
||||
@if (book?.metadata?.ageRating != null) {
|
||||
<span class="metadata-value metadata-link" (click)="goToAgeRating(book?.metadata?.ageRating!)">
|
||||
{{ getAgeRatingLabel(book?.metadata?.ageRating) }}
|
||||
</span>
|
||||
} @else {
|
||||
<span class="metadata-value">-</span>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="metadata-item">
|
||||
<span class="metadata-key">{{ t('contentRatingLabel') }}</span>
|
||||
@if (book?.metadata?.contentRating) {
|
||||
<span class="metadata-value metadata-link" (click)="goToContentRating(book?.metadata?.contentRating!)">
|
||||
{{ getContentRatingLabel(book?.metadata?.contentRating) }}
|
||||
</span>
|
||||
} @else {
|
||||
<span class="metadata-value">-</span>
|
||||
}
|
||||
</div>
|
||||
|
||||
@if (isAudiobook(book) && hasAudiobookMetadata(book)) {
|
||||
@let audio = book.metadata!.audiobookMetadata!;
|
||||
@if (book.metadata?.narrator) {
|
||||
<div class="metadata-item">
|
||||
<span class="metadata-key">{{ t('audiobookNarrator') }}</span>
|
||||
<a class="metadata-value metadata-link" (click)="goToNarrator(book.metadata!.narrator!)">
|
||||
{{ book.metadata?.narrator }}
|
||||
</a>
|
||||
</div>
|
||||
}
|
||||
@if (audio.durationSeconds) {
|
||||
<div class="metadata-item">
|
||||
<span class="metadata-key">{{ t('audiobookDuration') }}</span>
|
||||
<span class="metadata-value">{{ formatDuration(audio.durationSeconds) }}</span>
|
||||
</div>
|
||||
}
|
||||
@if (audio.chapterCount) {
|
||||
<div class="metadata-item">
|
||||
<span class="metadata-key">{{ t('audiobookChapters') }}</span>
|
||||
<span class="metadata-value">{{ audio.chapterCount }}</span>
|
||||
</div>
|
||||
}
|
||||
@if (book.metadata?.abridged != null) {
|
||||
<div class="metadata-item">
|
||||
<span class="metadata-key">{{ t('audiobookAbridged') }}</span>
|
||||
<span class="metadata-value">{{ book.metadata?.abridged ? t('abridged') : t('unabridged') }}</span>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
@if (hasDigitalFile(book)) {
|
||||
<div class="metadata-item">
|
||||
<span class="metadata-key">{{ t('fileSizeLabel') }}</span>
|
||||
@if (book?.primaryFile?.fileSizeKb) {
|
||||
<span class="metadata-value metadata-link" (click)="goToFileSizeRange(book?.primaryFile?.fileSizeKb!)">
|
||||
{{ formatFileSize(book?.primaryFile) }}
|
||||
</span>
|
||||
} @else {
|
||||
<span class="metadata-value">-</span>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@if (hasDigitalFile(book)) {
|
||||
<div class="file-path-section">
|
||||
<span class="metadata-key">{{ t('filePathLabel') }}</span>
|
||||
<i class="pi eye-icon" [ngClass]="showFilePath ? 'pi-eye-slash' : 'pi-eye'" (click)="showFilePath = !showFilePath"></i>
|
||||
@if (showFilePath) {
|
||||
<code class="file-path-code">{{ book?.primaryFile?.filePath }}</code>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@if (userService.currentUser(); as currentUser) {
|
||||
<div class="action-buttons-container">
|
||||
<div class="action-buttons">
|
||||
@if (navigationState()) {
|
||||
<div class="action-group navigation-group">
|
||||
<p-button
|
||||
icon="pi pi-chevron-left"
|
||||
[disabled]="!canNavigatePrevious()"
|
||||
(onClick)="navigatePrevious()"`
|
||||
outlined
|
||||
severity="secondary"
|
||||
[pTooltip]="t('goToPreviousBook')"
|
||||
tooltipPosition="bottom">
|
||||
</p-button>
|
||||
<span class="navigation-position">
|
||||
{{ navigationPosition() }}
|
||||
</span>
|
||||
<p-button
|
||||
icon="pi pi-chevron-right"
|
||||
iconPos="right"
|
||||
[disabled]="!canNavigateNext()"
|
||||
(onClick)="navigateNext()"
|
||||
severity="secondary"
|
||||
outlined
|
||||
[pTooltip]="t('goToNextBook')"
|
||||
tooltipPosition="bottom">
|
||||
</p-button>
|
||||
</div>
|
||||
}
|
||||
@if (hasDigitalFile(book)) {
|
||||
<div class="action-group primary-actions">
|
||||
@if (readMenuItems().length > 0) {
|
||||
<p-splitbutton [label]="getReadButtonLabel(book)" [icon]="getReadButtonIcon(book)" [model]="readMenuItems()" (onClick)="read(book.id)" severity="primary" class="read-button-responsive"/>
|
||||
} @else {
|
||||
<p-button [label]="getReadButtonLabel(book)" [icon]="getReadButtonIcon(book)" (onClick)="read(book.id)" severity="primary" class="read-button-responsive"/>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
<div class="action-group secondary-actions">
|
||||
@if ((currentUser.permissions.canDownload || currentUser.permissions.admin) && hasAnyFiles(book)) {
|
||||
@if ((book!.alternativeFormats && book!.alternativeFormats.length > 0) || (book!.supplementaryFiles && book!.supplementaryFiles.length > 0)) {
|
||||
<p-splitbutton [label]="(getDisplayFormat(book.primaryFile) ?? 'File') + ' · ' + formatFileSize(book.primaryFile)" icon="pi pi-download" [model]="downloadMenuItems()" (onClick)="download(book)" severity="success" outlined class="mobile-icon-only"/>
|
||||
} @else {
|
||||
<p-button [label]="(getDisplayFormat(book.primaryFile) ?? 'File') + ' · ' + formatFileSize(book.primaryFile)" icon="pi pi-download" severity="success" outlined (onClick)="download(book)" class="mobile-icon-only"></p-button>
|
||||
}
|
||||
}
|
||||
@if (currentUser.permissions.canEditMetadata || currentUser.permissions.admin) {
|
||||
<p-button
|
||||
[label]="isAutoFetching ? t('fetchingBtn') : t('fetchMetadataBtn')"
|
||||
[icon]="isAutoFetching ? 'pi pi-spin pi-spinner' : 'pi pi-bolt'"
|
||||
[outlined]="true"
|
||||
severity="warn"
|
||||
(onClick)="quickRefresh(book!.id)"
|
||||
[disabled]="isAutoFetching"
|
||||
[pTooltip]="t('fetchMetadataTooltip')"
|
||||
tooltipPosition="top"
|
||||
class="mobile-icon-only">
|
||||
</p-button>
|
||||
}
|
||||
@if (otherItems().length > 0) {
|
||||
<p-button icon="pi pi-ellipsis-v" severity="info" outlined (click)="entitymenu.toggle($event)"></p-button>
|
||||
<p-tieredMenu #entitymenu [model]="otherItems()" [popup]="true" appendTo="body"></p-tieredMenu>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="description-section">
|
||||
<div class="section-header">
|
||||
<i class="pi pi-align-left"></i>
|
||||
<span>{{ t('synopsisTitle') }}</span>
|
||||
</div>
|
||||
<div class="description-body">
|
||||
<div #descriptionContent [ngClass]="{ 'line-clamp-7': !isExpanded }" class="description-content">
|
||||
<div class="description-html" [innerHTML]="sanitizeDescription(book.metadata!.description)"></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>
|
||||
|
||||
@if (isComicBook(book) && hasComicMetadata(book)) {
|
||||
<div class="comic-metadata-section">
|
||||
<div class="section-header clickable" (click)="isComicSectionExpanded = !isComicSectionExpanded">
|
||||
<div class="section-header-left">
|
||||
<i class="pi pi-images"></i>
|
||||
<span>{{ t('comicDetailsTitle') }}</span>
|
||||
</div>
|
||||
<i class="pi section-toggle-icon" [ngClass]="isComicSectionExpanded ? 'pi-chevron-up' : 'pi-chevron-down'"></i>
|
||||
</div>
|
||||
|
||||
<div class="comic-metadata-content" [ngClass]="{'collapsed': !isComicSectionExpanded}">
|
||||
@let comic = book.metadata!.comicMetadata!;
|
||||
|
||||
<div class="comic-info-grid">
|
||||
@if (comic.issueNumber) {
|
||||
<div class="comic-info-item">
|
||||
<span class="comic-info-label">{{ t('comicIssue') }}</span>
|
||||
<span class="comic-info-value">#{{ comic.issueNumber }}</span>
|
||||
</div>
|
||||
}
|
||||
@if (comic.volumeName) {
|
||||
<div class="comic-info-item">
|
||||
<span class="comic-info-label">{{ t('comicVolume') }}</span>
|
||||
<span class="comic-info-value">
|
||||
{{ comic.volumeName }}
|
||||
@if (comic.volumeNumber) {
|
||||
<span class="comic-volume-number">Vol. {{ comic.volumeNumber }}</span>
|
||||
}
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
@if (comic.storyArc) {
|
||||
<div class="comic-info-item">
|
||||
<span class="comic-info-label">{{ t('comicStoryArc') }}</span>
|
||||
<span class="comic-info-value">
|
||||
{{ comic.storyArc }}
|
||||
@if (comic.storyArcNumber) {
|
||||
<span class="comic-arc-number">(#{{ comic.storyArcNumber }})</span>
|
||||
}
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
@if (comic.alternateSeries) {
|
||||
<div class="comic-info-item">
|
||||
<span class="comic-info-label">{{ t('comicAltSeries') }}</span>
|
||||
<span class="comic-info-value">
|
||||
{{ comic.alternateSeries }}
|
||||
@if (comic.alternateIssue) {
|
||||
#{{ comic.alternateIssue }}
|
||||
}
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
@if (comic.format) {
|
||||
<div class="comic-info-item">
|
||||
<span class="comic-info-label">{{ t('comicFormat') }}</span>
|
||||
<span class="comic-info-value">{{ comic.format }}</span>
|
||||
</div>
|
||||
}
|
||||
@if (comic.imprint) {
|
||||
<div class="comic-info-item">
|
||||
<span class="comic-info-label">{{ t('comicImprint') }}</span>
|
||||
<span class="comic-info-value">{{ comic.imprint }}</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@if (hasAnyCreators(comic)) {
|
||||
<div class="comic-subsection">
|
||||
<div class="comic-subsection-title">
|
||||
<i class="pi pi-users"></i>
|
||||
<span>{{ t('creatorsTitle') }}</span>
|
||||
</div>
|
||||
<div class="comic-creators-grid">
|
||||
@if (comic.pencillers?.length) {
|
||||
<div class="comic-creator-row">
|
||||
<span class="comic-creator-role">{{ t('pencillers') }}</span>
|
||||
<div class="comic-creator-names">
|
||||
@for (name of comic.pencillers; track name) {
|
||||
<a class="comic-creator-link" (click)="goToCreator(name, 'penciller')">{{ name }}</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (comic.inkers?.length) {
|
||||
<div class="comic-creator-row">
|
||||
<span class="comic-creator-role">{{ t('inkers') }}</span>
|
||||
<div class="comic-creator-names">
|
||||
@for (name of comic.inkers; track name) {
|
||||
<a class="comic-creator-link" (click)="goToCreator(name, 'inker')">{{ name }}</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (comic.colorists?.length) {
|
||||
<div class="comic-creator-row">
|
||||
<span class="comic-creator-role">{{ t('colorists') }}</span>
|
||||
<div class="comic-creator-names">
|
||||
@for (name of comic.colorists; track name) {
|
||||
<a class="comic-creator-link" (click)="goToCreator(name, 'colorist')">{{ name }}</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (comic.letterers?.length) {
|
||||
<div class="comic-creator-row">
|
||||
<span class="comic-creator-role">{{ t('letterers') }}</span>
|
||||
<div class="comic-creator-names">
|
||||
@for (name of comic.letterers; track name) {
|
||||
<a class="comic-creator-link" (click)="goToCreator(name, 'letterer')">{{ name }}</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (comic.coverArtists?.length) {
|
||||
<div class="comic-creator-row">
|
||||
<span class="comic-creator-role">{{ t('coverArtists') }}</span>
|
||||
<div class="comic-creator-names">
|
||||
@for (name of comic.coverArtists; track name) {
|
||||
<a class="comic-creator-link" (click)="goToCreator(name, 'coverArtist')">{{ name }}</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (comic.editors?.length) {
|
||||
<div class="comic-creator-row">
|
||||
<span class="comic-creator-role">{{ t('editors') }}</span>
|
||||
<div class="comic-creator-names">
|
||||
@for (name of comic.editors; track name) {
|
||||
<a class="comic-creator-link" (click)="goToCreator(name, 'editor')">{{ name }}</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (comic.characters?.length || comic.teams?.length || comic.locations?.length) {
|
||||
<div class="comic-subsection">
|
||||
<div class="comic-subsection-title">
|
||||
<i class="pi pi-globe"></i>
|
||||
<span>{{ t('universeTitle') }}</span>
|
||||
</div>
|
||||
<div class="comic-tags-container">
|
||||
@if (comic.characters?.length) {
|
||||
<div class="comic-tag-row">
|
||||
<span class="comic-tag-label">{{ t('characters') }}</span>
|
||||
<div class="comic-tag-list">
|
||||
@for (character of comic.characters; track character) {
|
||||
<a class="comic-tag-clickable" (click)="goToCharacter(character)">
|
||||
<app-tag color="cyan" size="xs">{{ character }}</app-tag>
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (comic.teams?.length) {
|
||||
<div class="comic-tag-row">
|
||||
<span class="comic-tag-label">{{ t('teams') }}</span>
|
||||
<div class="comic-tag-list">
|
||||
@for (team of comic.teams; track team) {
|
||||
<a class="comic-tag-clickable" (click)="goToTeam(team)">
|
||||
<app-tag color="violet" size="xs">{{ team }}</app-tag>
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (comic.locations?.length) {
|
||||
<div class="comic-tag-row">
|
||||
<span class="comic-tag-label">{{ t('locations') }}</span>
|
||||
<div class="comic-tag-list">
|
||||
@for (location of comic.locations; track location) {
|
||||
<a class="comic-tag-clickable" (click)="goToLocation(location)">
|
||||
<app-tag color="amber" size="xs">{{ location }}</app-tag>
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (comic.manga || comic.blackAndWhite || comic.readingDirection === 'rtl') {
|
||||
<div class="comic-properties">
|
||||
@if (comic.manga) {
|
||||
<span class="comic-property-badge manga">
|
||||
<i class="pi pi-book"></i> {{ t('manga') }}
|
||||
</span>
|
||||
}
|
||||
@if (comic.blackAndWhite) {
|
||||
<span class="comic-property-badge bw">
|
||||
<i class="pi pi-palette"></i> {{ t('blackAndWhite') }}
|
||||
</span>
|
||||
}
|
||||
@if (comic.readingDirection === 'rtl') {
|
||||
<span class="comic-property-badge rtl">
|
||||
<i class="pi pi-arrow-left"></i> {{ t('rightToLeft') }}
|
||||
</span>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (comic.webLink) {
|
||||
<div class="comic-web-link">
|
||||
<a [href]="comic.webLink" target="_blank" rel="noopener noreferrer" class="comic-external-link">
|
||||
<i class="pi pi-external-link"></i>
|
||||
<span>{{ formatWebLink(comic.webLink) }}</span>
|
||||
</a>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (comic.notes) {
|
||||
<div class="comic-notes">
|
||||
<div class="comic-notes-label">
|
||||
<i class="pi pi-file-edit"></i>
|
||||
<span>{{ t('notesLabel') }}</span>
|
||||
</div>
|
||||
<p class="comic-notes-content">{{ comic.notes }}</p>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<app-metadata-tabs
|
||||
[book]="book"
|
||||
[bookInSeries]="bookInSeries"
|
||||
[recommendedBooks]="recommendedBooks"
|
||||
(readBook)="onReadBook($event)"
|
||||
(downloadBook)="onDownloadBook($event)"
|
||||
(downloadFile)="onDownloadFile($event)"
|
||||
(downloadAllFiles)="onDownloadAllFiles($event)"
|
||||
(deleteBookFile)="onDeleteBookFile($event)"
|
||||
(deleteSupplementaryFile)="onDeleteSupplementaryFile($event)"
|
||||
(detachBookFile)="onDetachBookFile($event)">
|
||||
</app-metadata-tabs>
|
||||
|
||||
<p-dialog
|
||||
[header]="t('confirm.detachFileHeader')"
|
||||
[(visible)]="showDetachDialog"
|
||||
[modal]="true"
|
||||
[closable]="true"
|
||||
[style]="{ width: '450px' }"
|
||||
[breakpoints]="{ '575px': '95vw' }">
|
||||
<div class="detach-dialog-content">
|
||||
<p>{{ t('confirm.detachFileMessage', { fileName: detachFileName }) }}</p>
|
||||
<div class="detach-dialog-option">
|
||||
<p-checkbox
|
||||
[(ngModel)]="detachCopyMetadata"
|
||||
[binary]="true"
|
||||
inputId="copyMetadata">
|
||||
</p-checkbox>
|
||||
<label for="copyMetadata">{{ t('confirm.detachFileCopyMetadata') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
<ng-template #footer>
|
||||
<p-button
|
||||
[label]="'common.cancel' | transloco"
|
||||
severity="secondary"
|
||||
(onClick)="showDetachDialog = false">
|
||||
</p-button>
|
||||
<p-button
|
||||
[label]="t('confirm.detachFileBtn')"
|
||||
severity="warn"
|
||||
icon="pi pi-external-link"
|
||||
(onClick)="confirmDetach()">
|
||||
</p-button>
|
||||
</ng-template>
|
||||
</p-dialog>
|
||||
</div>
|
||||
} @else {
|
||||
<div class="loading-state" *transloco="let t; prefix: 'metadata.viewer'">
|
||||
<p-progressSpinner strokeWidth="4" fill="transparent" animationDuration=".8s"></p-progressSpinner>
|
||||
<p class="loading-text">{{ t('loadingBookDetails') }}</p>
|
||||
</div>
|
||||
}
|
||||
+1031
File diff suppressed because it is too large
Load Diff
+1411
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user