Performance Improvements (#2449)
This commit is contained in:
parent
419a827d42
commit
5ed1eebd26
34 changed files with 389 additions and 132 deletions
|
|
@ -45,6 +45,16 @@
|
|||
</ul>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="bookmarkTemplate !== undefined && groupedData.bookmarks.length > 0">
|
||||
<li class="list-group-item section-header"><h5>{{t('bookmarks')}}</h5></li>
|
||||
<ul class="list-group results">
|
||||
<li *ngFor="let option of groupedData.bookmarks; let index = index;" (click)="handleResultlick(option)" tabindex="0"
|
||||
class="list-group-item" role="option">
|
||||
<ng-container [ngTemplateOutlet]="bookmarkTemplate" [ngTemplateOutletContext]="{ $implicit: option, idx: index }"></ng-container>
|
||||
</li>
|
||||
</ul>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="libraryTemplate !== undefined && groupedData.libraries.length > 0">
|
||||
<li class="list-group-item section-header"><h5 id="libraries-group">{{t('libraries')}}</h5></li>
|
||||
<ul class="list-group results" role="group" aria-describedby="libraries-group">
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ export class GroupedTypeaheadComponent implements OnInit {
|
|||
@ContentChild('readingListTemplate') readingListTemplate!: TemplateRef<any>;
|
||||
@ContentChild('fileTemplate') fileTemplate!: TemplateRef<any>;
|
||||
@ContentChild('chapterTemplate') chapterTemplate!: TemplateRef<any>;
|
||||
@ContentChild('bookmarkTemplate') bookmarkTemplate!: TemplateRef<any>;
|
||||
private readonly destroyRef = inject(DestroyRef);
|
||||
|
||||
|
||||
|
|
@ -96,7 +97,7 @@ export class GroupedTypeaheadComponent implements OnInit {
|
|||
get hasData() {
|
||||
return !(this.noResultsTemplate != undefined && !this.groupedData.persons.length && !this.groupedData.collections.length
|
||||
&& !this.groupedData.series.length && !this.groupedData.persons.length && !this.groupedData.tags.length && !this.groupedData.genres.length && !this.groupedData.libraries.length
|
||||
&& !this.groupedData.files.length && !this.groupedData.chapters.length);
|
||||
&& !this.groupedData.files.length && !this.groupedData.chapters.length && !this.groupedData.bookmarks.length);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -51,6 +51,23 @@
|
|||
</div>
|
||||
</ng-template>
|
||||
|
||||
<ng-template #bookmarkTemplate let-item>
|
||||
<div style="display: flex;padding: 5px;" (click)="clickBookmarkSearchResult(item)">
|
||||
<div style="width: 24px" class="me-1">
|
||||
<app-image class="me-3 search-result" width="24px" [imageUrl]="imageService.getSeriesCoverImage(item.seriesId)"></app-image>
|
||||
</div>
|
||||
<div class="ms-1">
|
||||
<app-series-format [format]="item.format"></app-series-format>
|
||||
<ng-container *ngIf="searchTerm.toLowerCase().trim() as st">
|
||||
<span *ngIf="item.seriesName.toLowerCase().trim().indexOf(st) >= 0; else localizedName">{{item.seriesName}}</span>
|
||||
<ng-template #localizedName>
|
||||
<span [innerHTML]="item.localizedSeriesName"></span>
|
||||
</ng-template>
|
||||
</ng-container>
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
<ng-template #collectionTemplate let-item>
|
||||
<div style="display: flex;padding: 5px;" (click)="clickCollectionSearchResult(item)">
|
||||
<div style="width: 24px" class="me-1">
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ import {FilterUtilitiesService} from "../../../shared/_services/filter-utilities
|
|||
import {FilterStatement} from "../../../_models/metadata/v2/filter-statement";
|
||||
import {FilterField} from "../../../_models/metadata/v2/filter-field";
|
||||
import {FilterComparison} from "../../../_models/metadata/v2/filter-comparison";
|
||||
import {BookmarkSearchResult} from "../../../_models/search/bookmark-search-result";
|
||||
|
||||
@Component({
|
||||
selector: 'app-nav-header',
|
||||
|
|
@ -197,6 +198,15 @@ export class NavHeaderComponent implements OnInit {
|
|||
this.router.navigate(['library', libraryId, 'series', seriesId]);
|
||||
}
|
||||
|
||||
clickBookmarkSearchResult(item: BookmarkSearchResult) {
|
||||
this.clearSearch();
|
||||
const libraryId = item.libraryId;
|
||||
const seriesId = item.seriesId;
|
||||
this.router.navigate(['library', libraryId, 'series', seriesId, 'manga', item.chapterId], {queryParams: {
|
||||
incognitoMode: false, bookmarkMode: true
|
||||
}});
|
||||
}
|
||||
|
||||
clickFileSearchResult(item: MangaFile) {
|
||||
this.clearSearch();
|
||||
this.searchService.getSeriesForMangaFile(item.id).subscribe(series => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue