New PDF Reader (#1324)
* Refactored all the code that opens the reader to use a unified function. Added new library and setup basic pdf reader route. * Progress saving is implemented. Targeting ES6 now. * Customized the toolbar to remove things we don't want, made the download button download with correct filename. Adjusted zoom setting to work well on first load regardless of device. * Stream the pdf file to the UI rather than handling the download ourselves. * Started implementing a custom toolbar. * Fixed up the jump bar calculations * Fixed filtering being broken * Pushing up for Robbie to cleanup the toolbar layout * Added an additional button. Working on logic while robbie takes styling * Tried to fix the code for robbie * Tweaks for fonts * Added button for book mode, but doesn't seem to work after renderer is built * Removed book mode * Removed the old image caching code for pdfs as it's not needed with new reader * Removed the interfaces to extract images from pdf. * Fixed original pagination area not scaling correctly * Integrated series remove events to library detail * Cleaned up the getter naming convention * Cleaned up some of the manga reader code to reduce cluter and improve re-use * Implemented Japanese parser support for volume and chapters. * Fixed a bug where resetting scroll in manga reader wasn't working * Fixed a bug where word count grew on each scan. * Removed unused variable * Ensure we calculate word count on files with their own cache timestamp * Adjusted size of reel headers * Put some code in for moving on original image with keyboard, but it's not in use. * Cleaned up the css for the pdf reader * Cleaned up the code * Tweaked the list item so we show scrollbar now when fully read
This commit is contained in:
parent
384fac68c4
commit
3ab3a10ae7
45 changed files with 2309 additions and 208 deletions
|
|
@ -19,6 +19,7 @@ import { NavService } from '../_services/nav.service';
|
|||
import { FilterUtilitiesService } from '../shared/_services/filter-utilities.service';
|
||||
import { FilterSettings } from '../metadata-filter/filter-settings';
|
||||
import { JumpKey } from '../_models/jumpbar/jump-key';
|
||||
import { SeriesRemovedEvent } from '../_models/events/series-removed-event';
|
||||
|
||||
@Component({
|
||||
selector: 'app-library-detail',
|
||||
|
|
@ -123,10 +124,15 @@ export class LibraryDetailComponent implements OnInit, OnDestroy {
|
|||
|
||||
ngOnInit(): void {
|
||||
this.hubService.messages$.pipe(debounceTime(6000), takeUntil(this.onDestroy)).subscribe((event) => {
|
||||
if (event.event !== EVENTS.SeriesAdded) return;
|
||||
const seriesAdded = event.payload as SeriesAddedEvent;
|
||||
if (seriesAdded.libraryId !== this.libraryId) return;
|
||||
this.loadPage();
|
||||
if (event.event === EVENTS.SeriesAdded) {
|
||||
const seriesAdded = event.payload as SeriesAddedEvent;
|
||||
if (seriesAdded.libraryId !== this.libraryId) return;
|
||||
this.loadPage();
|
||||
} else if (event.event === EVENTS.SeriesRemoved) {
|
||||
const seriesRemoved = event.payload as SeriesRemovedEvent;
|
||||
if (seriesRemoved.libraryId !== this.libraryId) return;
|
||||
this.loadPage();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -194,17 +200,19 @@ export class LibraryDetailComponent implements OnInit, OnDestroy {
|
|||
this.loadingSeries = true;
|
||||
this.filterActive = !this.utilityService.deepEqual(this.filter, this.filterActiveCheck);
|
||||
this.seriesService.getSeriesForLibrary(0, this.pagination?.currentPage, this.pagination?.itemsPerPage, this.filter).pipe(take(1)).subscribe(series => {
|
||||
//this.series = series.result; // Non-infinite scroll version
|
||||
if (this.series.length === 0) {
|
||||
this.series = series.result;
|
||||
} else {
|
||||
if (direction === 1) {
|
||||
//this.series = [...this.series, ...series.result];
|
||||
this.series.concat(series.result);
|
||||
} else {
|
||||
this.series = [...series.result, ...this.series];
|
||||
}
|
||||
}
|
||||
this.series = series.result;
|
||||
|
||||
// For Pagination
|
||||
// if (this.series.length === 0) {
|
||||
// this.series = series.result;
|
||||
// } else {
|
||||
// if (direction === 1) {
|
||||
// //this.series = [...this.series, ...series.result];
|
||||
// this.series.concat(series.result);
|
||||
// } else {
|
||||
// this.series = [...series.result, ...this.series];
|
||||
// }
|
||||
// }
|
||||
|
||||
this.pagination = series.pagination;
|
||||
this.loadingSeries = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue