Release Testing Day 1 (#1933)
* Enhance plugin/authenticate to allow RefreshToken to be returned as well. * When typing a series name, min, or max filter, press enter to apply metadata filter. * Cleaned up the documentation around MaxCount and TotalCount * Fixed a bug where PublicationStatus wasn't being correctly set due to some strange logic I coded. * Fixed bookmark mode not having access to critical page dimensions. Fetching bookmark info api now returns dimensions by default. * Fixed pagination scaling code for different fitting options * Fixed missing code to persist page split in manga reader * Removed unneeded prefetch of blank images in bookmark mode
This commit is contained in:
parent
f99a75c2d7
commit
e3467457ea
14 changed files with 119 additions and 40 deletions
|
@ -1,3 +1,4 @@
|
|||
import { FileDimension } from "src/app/manga-reader/_models/file-dimension";
|
||||
import { LibraryType } from "../library";
|
||||
import { MangaFormat } from "../manga-format";
|
||||
|
||||
|
@ -8,4 +9,12 @@ export interface BookmarkInfo {
|
|||
libraryId: number;
|
||||
libraryType: LibraryType;
|
||||
pages: number;
|
||||
/**
|
||||
* This will not always be present. Depends on if asked from backend.
|
||||
*/
|
||||
pageDimensions?: Array<FileDimension>;
|
||||
/**
|
||||
* This will not always be present. Depends on if asked from backend.
|
||||
*/
|
||||
doublePairs?: {[key: number]: number};
|
||||
}
|
|
@ -380,11 +380,11 @@
|
|||
<div class="row g-0 mb-2" *ngIf="metadata">
|
||||
<div class="col-md-6">
|
||||
Max Items: {{metadata.maxCount}}
|
||||
<i class="fa fa-info-circle ms-1" placement="right" ngbTooltip="Max of Volume/Issue field in ComicInfo. Used in conjunction with total items to determine publication status." role="button" tabindex="0"></i>
|
||||
<i class="fa fa-info-circle ms-1" placement="right" ngbTooltip="Highest Count found across all ComicInfo in the Series" role="button" tabindex="0"></i>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
Total Items: {{metadata.totalCount}}
|
||||
<i class="fa fa-info-circle ms-1" placement="right" ngbTooltip="Total number of issues/volumes in the series" role="button" tabindex="0"></i>
|
||||
<i class="fa fa-info-circle ms-1" placement="right" ngbTooltip="Max Issue or Volume field from all ComicInfo in the series" role="button" tabindex="0"></i>
|
||||
</div>
|
||||
<div class="col-md-6">Publication Status: {{metadata.publicationStatus | publicationStatus}}</div>
|
||||
<div class="col-md-6">Total Pages: {{series.pages}}</div>
|
||||
|
|
|
@ -373,15 +373,23 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
if (this.FittingOption !== FITTING_OPTION.HEIGHT) {
|
||||
return this.mangaReaderService.getPageDimensions(this.pageNum)?.height + 'px';
|
||||
}
|
||||
|
||||
return this.readingArea?.nativeElement?.clientHeight + 'px';
|
||||
}
|
||||
|
||||
// This is for the pagination area
|
||||
get MaxHeight() {
|
||||
if (this.FittingOption !== FITTING_OPTION.HEIGHT) {
|
||||
return Math.min(this.readingArea?.nativeElement?.clientHeight, this.mangaReaderService.getPageDimensions(this.pageNum)?.height!) + 'px';
|
||||
if (this.FittingOption === FITTING_OPTION.HEIGHT) {
|
||||
return 'calc(var(--vh) * 100)';
|
||||
}
|
||||
return 'calc(var(--vh) * 100)';
|
||||
|
||||
const needsScrolling = this.readingArea?.nativeElement?.scrollHeight > this.readingArea?.nativeElement?.clientHeight;
|
||||
if (this.readingArea?.nativeElement?.clientHeight <= this.mangaReaderService.getPageDimensions(this.pageNum)?.height!) {
|
||||
if (needsScrolling) {
|
||||
return Math.min(this.readingArea?.nativeElement?.scrollHeight, this.mangaReaderService.getPageDimensions(this.pageNum)?.height!) + 'px';
|
||||
}
|
||||
}
|
||||
return this.readingArea?.nativeElement?.clientHeight + 'px';
|
||||
}
|
||||
|
||||
get RightPaginationOffset() {
|
||||
|
@ -806,6 +814,7 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
this.subtitle = 'Bookmarks';
|
||||
this.libraryType = bookmarkInfo.libraryType;
|
||||
this.maxPages = bookmarkInfo.pages;
|
||||
this.mangaReaderService.load(bookmarkInfo);
|
||||
|
||||
// Due to change detection rules in Angular, we need to re-create the options object to apply the change
|
||||
const newOptions: Options = Object.assign({}, this.pageOptions);
|
||||
|
@ -814,10 +823,6 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
this.inSetup = false;
|
||||
this.cdRef.markForCheck();
|
||||
|
||||
for (let i = 0; i < PREFETCH_PAGES; i++) {
|
||||
this.cachedImages.push(new Image())
|
||||
}
|
||||
|
||||
this.goToPageEvent = new BehaviorSubject<number>(this.pageNum);
|
||||
|
||||
this.render();
|
||||
|
@ -1625,7 +1630,9 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
data.readingDirection = this.readingDirection;
|
||||
data.emulateBook = modelSettings.emulateBook;
|
||||
data.swipeToPaginate = modelSettings.swipeToPaginate;
|
||||
this.accountService.updatePreferences(data).subscribe((updatedPrefs) => {
|
||||
data.pageSplitOption = parseInt(modelSettings.pageSplitOption, 10);
|
||||
|
||||
this.accountService.updatePreferences(data).subscribe(updatedPrefs => {
|
||||
this.toastr.success('User preferences updated');
|
||||
if (this.user) {
|
||||
this.user.preferences = updatedPrefs;
|
||||
|
|
|
@ -5,6 +5,7 @@ import { ReaderService } from 'src/app/_services/reader.service';
|
|||
import { ChapterInfo } from '../_models/chapter-info';
|
||||
import { DimensionMap } from '../_models/file-dimension';
|
||||
import { FITTING_OPTION } from '../_models/reader-enums';
|
||||
import { BookmarkInfo } from 'src/app/_models/manga-reader/bookmark-info';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
|
@ -19,7 +20,7 @@ export class ManagaReaderService {
|
|||
this.renderer = rendererFactory.createRenderer(null, null);
|
||||
}
|
||||
|
||||
load(chapterInfo: ChapterInfo) {
|
||||
load(chapterInfo: ChapterInfo | BookmarkInfo) {
|
||||
chapterInfo.pageDimensions!.forEach(d => {
|
||||
this.pageDimensions[d.pageNumber] = {
|
||||
height: d.height,
|
||||
|
|
|
@ -321,7 +321,7 @@
|
|||
<label for="series-name" class="form-label me-1">Series Name</label><i class="fa fa-info-circle" aria-hidden="true" placement="right" [ngbTooltip]="seriesNameFilterTooltip" role="button" tabindex="0"></i>
|
||||
<span class="visually-hidden" id="filter-series-name-help"><ng-container [ngTemplateOutlet]="seriesNameFilterTooltip"></ng-container></span>
|
||||
<ng-template #seriesNameFilterTooltip>Series name will filter against Name, Sort Name, or Localized Name</ng-template>
|
||||
<input type="text" id="series-name" formControlName="seriesNameQuery" class="form-control" aria-describedby="filter-series-name-help">
|
||||
<input type="text" id="series-name" formControlName="seriesNameQuery" class="form-control" aria-describedby="filter-series-name-help" (keyup.enter)="apply()">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -329,14 +329,14 @@
|
|||
<form [formGroup]="releaseYearRange" class="d-flex justify-content-between">
|
||||
<div class="mb-3">
|
||||
<label for="release-year-min" class="form-label">Release</label>
|
||||
<input type="text" id="release-year-min" formControlName="min" class="form-control" style="width: 62px" placeholder="Min">
|
||||
<input type="text" id="release-year-min" formControlName="min" class="form-control" style="width: 62px" placeholder="Min" (keyup.enter)="apply()">
|
||||
</div>
|
||||
<div style="margin-top: 37px !important;">
|
||||
<i class="fa-solid fa-minus" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="mb-3" style="margin-top: 0.5rem">
|
||||
<label for="release-year-max" class="form-label"><span class="visually-hidden">Max</span></label>
|
||||
<input type="text" id="release-year-max" formControlName="max" class="form-control" style="width: 62px" placeholder="Max">
|
||||
<input type="text" id="release-year-max" formControlName="max" class="form-control" style="width: 62px" placeholder="Max" (keyup.enter)="apply()">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue