(Kavita+) External Series Detail (#2309)
This commit is contained in:
parent
bd62e00ec5
commit
6067c9233c
32 changed files with 2354 additions and 726 deletions
|
|
@ -11,6 +11,8 @@
|
|||
<h6 class="subtitle-with-actionables text-break" title="Localized Name">{{series.localizedName}}</h6>
|
||||
</ng-container>
|
||||
|
||||
|
||||
|
||||
<ng-template #extrasDrawer let-offcanvas>
|
||||
<div style="margin-top: 56px">
|
||||
<div class="offcanvas-header">
|
||||
|
|
@ -312,10 +314,10 @@
|
|||
<div class="card-container row g-0" #container>
|
||||
<ng-container *ngFor="let item of scroll.viewPortItems; let idx = index; trackBy: trackBySeriesIdentify">
|
||||
<ng-container *ngIf="!item.hasOwnProperty('coverUrl'); else externalRec">
|
||||
<app-series-card class="col-auto mt-2 mb-2" [data]="item" [libraryId]="item.libraryId"></app-series-card>
|
||||
<app-series-card class="col-auto mt-2 mb-2" [data]="item" [previewOnClick]="true" [libraryId]="item.libraryId"></app-series-card>
|
||||
</ng-container>
|
||||
<ng-template #externalRec>
|
||||
<app-external-series-card class="col-auto mt-2 mb-2" [data]="item"></app-external-series-card>
|
||||
<app-external-series-card class="col-auto mt-2 mb-2" [previewOnClick]="true" [data]="item"></app-external-series-card>
|
||||
</ng-template>
|
||||
</ng-container>
|
||||
</div>
|
||||
|
|
@ -325,14 +327,18 @@
|
|||
<ng-container *ngIf="!item.hasOwnProperty('coverUrl'); else externalRec">
|
||||
<app-external-list-item [imageUrl]="imageService.getSeriesCoverImage(item.id)" imageWidth="130px" imageHeight="" [summary]="item.summary">
|
||||
<ng-container title>
|
||||
<a href="/library/{{item.libraryId}}/series/{{item.id}}">{{item.name}}</a>
|
||||
<span (click)="previewSeries(item, false); $event.stopPropagation(); $event.preventDefault();">
|
||||
<a href="/library/{{item.libraryId}}/series/{{item.id}}">{{item.name}}</a>
|
||||
</span>
|
||||
</ng-container>
|
||||
</app-external-list-item>
|
||||
</ng-container>
|
||||
<ng-template #externalRec>
|
||||
<app-external-list-item [imageUrl]="item.coverUrl" imageWidth="130px" imageHeight="" [summary]="item.summary">
|
||||
<ng-container title>
|
||||
<a [href]="item.url" target="_blank" rel="noreferrer nofollow">{{item.name}}</a>
|
||||
<span (click)="previewSeries(item, true); $event.stopPropagation(); $event.preventDefault();">
|
||||
<a [href]="item.url" target="_blank" rel="noreferrer nofollow">{{item.name}}</a>
|
||||
</span>
|
||||
</ng-container>
|
||||
</app-external-list-item>
|
||||
</ng-template>
|
||||
|
|
|
|||
|
|
@ -71,6 +71,10 @@ import { TagBadgeComponent } from '../../../shared/tag-badge/tag-badge.component
|
|||
import { SideNavCompanionBarComponent } from '../../../sidenav/_components/side-nav-companion-bar/side-nav-companion-bar.component';
|
||||
import {TranslocoDirective, TranslocoService} from "@ngneat/transloco";
|
||||
import {CardActionablesComponent} from "../../../_single-module/card-actionables/card-actionables.component";
|
||||
import {ExternalSeries} from "../../../_models/series-detail/external-series";
|
||||
import {
|
||||
SeriesPreviewDrawerComponent
|
||||
} from "../../../_single-module/series-preview-drawer/series-preview-drawer.component";
|
||||
|
||||
interface RelatedSeriesPair {
|
||||
series: Series;
|
||||
|
|
@ -810,5 +814,22 @@ export class SeriesDetailComponent implements OnInit, AfterContentChecked {
|
|||
this.cdRef.markForCheck();
|
||||
}
|
||||
|
||||
protected readonly undefined = undefined;
|
||||
previewSeries(item: Series | ExternalSeries, isExternal: boolean) {
|
||||
const ref = this.offcanvasService.open(SeriesPreviewDrawerComponent, {position: 'end', panelClass: 'navbar-offset'});
|
||||
ref.componentInstance.isExternalSeries = isExternal;
|
||||
ref.componentInstance.name = item.name;
|
||||
|
||||
if (isExternal) {
|
||||
const external = item as ExternalSeries;
|
||||
ref.componentInstance.aniListId = external.aniListId;
|
||||
ref.componentInstance.malId = external.malId;
|
||||
} else {
|
||||
const local = item as Series;
|
||||
ref.componentInstance.seriesId = local.id;
|
||||
ref.componentInstance.libraryId = local.libraryId;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue