Webtoon fixes + Random release stuff (#1048)
* Refactored the way cover images are updated from SignalR to use an explicit event that is sent at a granular level for a given type of entity. Fixed a bad event listener for RefreshMetadata (now removed) to update metadata on Series Detail. Now uses ScanService, which indicates a series has completed a scan. * Lots of attempts at making webtoon stable. Kinda working kinda not. * Added a new boolean to hide images until the first prefetch loads the images, to prevent jankiness * On Search, remove : from query * Added HasBookmark and NumberOfLibraries to stat service * Cleaned up some dead code * Fixed a bug where page number wasn't reset between chapter loads with infinite scroller * Added recently added series back into the dashboard. * Cleaned up some code in search bar
This commit is contained in:
parent
be1a9187e5
commit
b571633eab
13 changed files with 93 additions and 61 deletions
|
|
@ -10,7 +10,7 @@ import { NavService } from '../_services/nav.service';
|
|||
import { ReadingDirection } from '../_models/preferences/reading-direction';
|
||||
import { ScalingOption } from '../_models/preferences/scaling-option';
|
||||
import { PageSplitOption } from '../_models/preferences/page-split-option';
|
||||
import { forkJoin, ReplaySubject, Subject } from 'rxjs';
|
||||
import { BehaviorSubject, forkJoin, ReplaySubject, Subject } from 'rxjs';
|
||||
import { ToastrService } from 'ngx-toastr';
|
||||
import { KEY_CODES, UtilityService, Breakpoint } from '../shared/_services/utility.service';
|
||||
import { CircularArray } from '../shared/data-structures/circular-array';
|
||||
|
|
@ -126,7 +126,8 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
/**
|
||||
* An event emiter when a page change occurs. Used soley by the webtoon reader.
|
||||
*/
|
||||
goToPageEvent: ReplaySubject<number> = new ReplaySubject<number>();
|
||||
goToPageEvent!: BehaviorSubject<number>;
|
||||
|
||||
/**
|
||||
* An event emiter when a bookmark on a page change occurs. Used soley by the webtoon reader.
|
||||
*/
|
||||
|
|
@ -221,6 +222,10 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
* Library Type used for rendering chapter or issue
|
||||
*/
|
||||
libraryType: LibraryType = LibraryType.Manga;
|
||||
/**
|
||||
* Used for webtoon reader. When loading pages or data, this will disable the reader
|
||||
*/
|
||||
inSetup: boolean = true;
|
||||
|
||||
private readonly onDestroy = new Subject<void>();
|
||||
|
||||
|
|
@ -424,6 +429,13 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
this.nextChapterPrefetched = false;
|
||||
this.pageNum = 0;
|
||||
this.pagingDirection = PAGING_DIRECTION.FORWARD;
|
||||
this.inSetup = true;
|
||||
|
||||
if (this.goToPageEvent) {
|
||||
// There was a bug where goToPage was emitting old values into infinite scroller between chapter loads. We explicity clear it out between loads
|
||||
// and we use a BehaviourSubject to ensure only latest value is sent
|
||||
this.goToPageEvent.complete();
|
||||
}
|
||||
|
||||
forkJoin({
|
||||
progress: this.readerService.getProgress(this.chapterId),
|
||||
|
|
@ -445,6 +457,8 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
page = this.maxPages - 1;
|
||||
}
|
||||
this.setPageNum(page);
|
||||
this.goToPageEvent = new BehaviorSubject<number>(this.pageNum);
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -453,11 +467,14 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
newOptions.ceil = this.maxPages - 1; // We -1 so that the slider UI shows us hitting the end, since visually we +1 everything.
|
||||
this.pageOptions = newOptions;
|
||||
|
||||
// TODO: Move this into ChapterInfo
|
||||
this.libraryService.getLibraryType(results.chapterInfo.libraryId).pipe(take(1)).subscribe(type => {
|
||||
this.libraryType = type;
|
||||
this.updateTitle(results.chapterInfo, type);
|
||||
});
|
||||
|
||||
this.inSetup = false;
|
||||
|
||||
|
||||
|
||||
// From bookmarks, create map of pages to make lookup time O(1)
|
||||
|
|
@ -1019,7 +1036,7 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
|
||||
this.setPageNum(page);
|
||||
this.refreshSlider.emit();
|
||||
this.goToPageEvent.next(page);
|
||||
this.goToPageEvent.next(page);
|
||||
this.render();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue