Misc Changes (#2015)

* Updated ng-bootstrap

* Fixed an issue where jumpbar would be disabled when it shouldn't have been.

* When there are duplicate files that make up a volume, show the count on series detail.

* Added basic ISBN searching which will return a chapter back.
This commit is contained in:
Joe Milazzo 2023-05-26 13:34:23 -05:00 committed by GitHub
parent c57244abd1
commit a2f4bc712c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 53 additions and 51 deletions

View File

@ -348,11 +348,11 @@ public class SeriesRepository : ISeriesRepository
result.Series = _context.Series
.Where(s => libraryIds.Contains(s.LibraryId))
.Where(s => (EF.Functions.Like(s.Name, $"%{searchQuery}%")
.Where(s => EF.Functions.Like(s.Name, $"%{searchQuery}%")
|| (s.OriginalName != null && EF.Functions.Like(s.OriginalName, $"%{searchQuery}%"))
|| (s.LocalizedName != null && EF.Functions.Like(s.LocalizedName, $"%{searchQuery}%"))
|| (EF.Functions.Like(s.NormalizedName, $"%{searchQueryNormalized}%"))
|| (hasYearInQuery && s.Metadata.ReleaseYear == yearComparison)))
|| (hasYearInQuery && s.Metadata.ReleaseYear == yearComparison))
.RestrictAgainstAgeRestriction(userRating)
.Include(s => s.Library)
.OrderBy(s => s.SortName!.ToLower())
@ -430,7 +430,9 @@ public class SeriesRepository : ISeriesRepository
result.Chapters = await _context.Chapter
.Include(c => c.Files)
.Where(c => EF.Functions.Like(c.TitleName, $"%{searchQuery}%"))
.Where(c => EF.Functions.Like(c.TitleName, $"%{searchQuery}%")
|| EF.Functions.Like(c.ISBN, $"%{searchQuery}%")
)
.Where(c => c.Files.All(f => fileIds.Contains(f.Id)))
.AsSplitQuery()
.Take(maxRecords)

View File

@ -144,14 +144,4 @@ public static class Seed
}
await context.SaveChangesAsync();
}
// /// <summary>
// /// Responsible to copy (not overwrite) a set of favicons that Kavita can't parse from websites.
// /// </summary>
// /// <param name="directoryService"></param>
// /// <returns></returns>
// public static Task SeedFavicons(IDirectoryService directoryService)
// {
//
// }
}

View File

@ -22,7 +22,7 @@
"@iharbeck/ngx-virtual-scroller": "^16.0.0",
"@iplab/ngx-file-upload": "^16.0.1",
"@microsoft/signalr": "^7.0.5",
"@ng-bootstrap/ng-bootstrap": "^14.1.1",
"@ng-bootstrap/ng-bootstrap": "^15.0.0",
"@popperjs/core": "^2.11.7",
"@swimlane/ngx-charts": "^20.1.2",
"@tweenjs/tween.js": "^20.0.3",
@ -3697,17 +3697,17 @@
}
},
"node_modules/@ng-bootstrap/ng-bootstrap": {
"version": "14.1.1",
"resolved": "https://registry.npmjs.org/@ng-bootstrap/ng-bootstrap/-/ng-bootstrap-14.1.1.tgz",
"integrity": "sha512-3EIc+lCmqUlr7sghzx0r28sjk771zvyqe3SXkrT7grYFzQCVbjtms6Wr9OPbdbmpqDNXG6a8llUoyVgtp1B2Tg==",
"version": "15.0.0",
"resolved": "https://registry.npmjs.org/@ng-bootstrap/ng-bootstrap/-/ng-bootstrap-15.0.0.tgz",
"integrity": "sha512-BA/SI7sURpKwIex6bj2ujL+xUh8oYMrc5POdGC8sVe+yX3NRS0xNbozI6oke6pL2PpYq+/zaJTmuEJsEMCplZA==",
"dependencies": {
"tslib": "^2.3.0"
},
"peerDependencies": {
"@angular/common": "^15.0.0",
"@angular/core": "^15.0.0",
"@angular/forms": "^15.0.0",
"@angular/localize": "^15.0.0",
"@angular/common": "^16.0.0",
"@angular/core": "^16.0.0",
"@angular/forms": "^16.0.0",
"@angular/localize": "^16.0.0",
"@popperjs/core": "^2.11.6",
"rxjs": "^6.5.3 || ^7.4.0"
}

View File

@ -26,7 +26,7 @@
"@iharbeck/ngx-virtual-scroller": "^16.0.0",
"@iplab/ngx-file-upload": "^16.0.1",
"@microsoft/signalr": "^7.0.5",
"@ng-bootstrap/ng-bootstrap": "^14.1.1",
"@ng-bootstrap/ng-bootstrap": "^15.0.0",
"@popperjs/core": "^2.11.7",
"@swimlane/ngx-charts": "^20.1.2",
"@tweenjs/tween.js": "^20.0.3",

View File

@ -1,7 +1,22 @@
import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
import { DOCUMENT } from '@angular/common';
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChild, ElementRef, EventEmitter, HostListener,
Inject, Input, OnChanges, OnDestroy, OnInit, Output, TemplateRef, TrackByFunction, ViewChild } from '@angular/core';
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
ContentChild,
ElementRef,
EventEmitter,
HostListener,
Inject,
Input,
OnChanges,
OnInit,
Output,
TemplateRef,
TrackByFunction,
ViewChild
} from '@angular/core';
import { Router } from '@angular/router';
import { VirtualScrollerComponent } from '@iharbeck/ngx-virtual-scroller';
import { Subject } from 'rxjs';
@ -22,7 +37,7 @@ import { ScrollService } from 'src/app/_services/scroll.service';
styleUrls: ['./card-detail-layout.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class CardDetailLayoutComponent implements OnInit, OnDestroy, OnChanges {
export class CardDetailLayoutComponent implements OnInit, OnChanges {
@Input() header: string = '';
@Input() isLoading: boolean = false;
@ -67,8 +82,6 @@ export class CardDetailLayoutComponent implements OnInit, OnDestroy, OnChanges {
updateApplied: number = 0;
hasResumedJumpKey: boolean = false;
private onDestory: Subject<void> = new Subject();
get Breakpoint() {
return Breakpoint;
}
@ -99,6 +112,8 @@ export class CardDetailLayoutComponent implements OnInit, OnDestroy, OnChanges {
this.changeDetectionRef.markForCheck();
}
console.log('filterSettings: ', this.filterSettings)
if (this.pagination === undefined) {
this.pagination = {currentPage: 1, itemsPerPage: this.items.length, totalItems: this.items.length, totalPages: 1};
this.changeDetectionRef.markForCheck();
@ -138,14 +153,8 @@ export class CardDetailLayoutComponent implements OnInit, OnDestroy, OnChanges {
}
}
ngOnDestroy() {
this.onDestory.next();
this.onDestory.complete();
}
hasCustomSort() {
return this.filter.sortOptions !== null || this.filterSettings?.presets?.sortOptions !== null;
return this.filter.sortOptions !== null || this.filterSettings?.presets?.sortOptions !== undefined;
}
performAction(action: ActionItem<any>) {

View File

@ -160,6 +160,7 @@
<app-card-item class="col-auto mt-2 mb-2" *ngIf="item.volume.number !== 0" [entity]="item.volume" [title]="item.volume.name" (click)="openVolume(item.volume)"
[imageUrl]="imageService.getVolumeCoverImage(item.volume.id)"
[read]="item.volume.pagesRead" [total]="item.volume.pages" [actions]="volumeActions"
[count]="item.volume.chapters[0].files.length"
(selection)="bulkSelectionService.handleCardSelection('volume', scroll.viewPortInfo.startIndexWithBuffer + idx, volumes.length, $event)"
[selected]="bulkSelectionService.isCardSelected('volume', scroll.viewPortInfo.startIndexWithBuffer + idx)" [allowSelection]="true"></app-card-item>
</ng-container>
@ -167,7 +168,7 @@
<app-card-item class="col-auto mt-2 mb-2" *ngIf="!item.chapter.isSpecial" [entity]="item.chapter" [title]="item.chapter.title" (click)="openChapter(item.chapter)"
[imageUrl]="imageService.getChapterCoverImage(item.chapter.id)"
[read]="item.chapter.pagesRead" [total]="item.chapter.pages" [actions]="chapterActions"
[count]="item.chapter.files.length"
[count]="item.volume.chapters[0].files.length"
(selection)="bulkSelectionService.handleCardSelection('chapter', scroll.viewPortInfo.startIndexWithBuffer + idx, storyChapters.length, $event)"
[selected]="bulkSelectionService.isCardSelected('chapter', scroll.viewPortInfo.startIndexWithBuffer + idx)" [allowSelection]="true"></app-card-item>
</ng-template>

View File

@ -7,7 +7,7 @@
"name": "GPL-3.0",
"url": "https://github.com/Kareadita/Kavita/blob/develop/LICENSE"
},
"version": "0.7.2.18"
"version": "0.7.2.20"
},
"servers": [
{