Misc Fixes and Changes (#927)

* Cleaned up a ton of warnings/suggestions from the IDE.

* Fixed a bug when clearing the filters some presets could be undone.

* Renamed a class in the OPDS spec

* Simplified logic for when Fit To Screen rendering logic occurs. It now works always rather than only on cover images.

* Give some additional info to the user on what the differences between Library Types are

* Don't scan .qpkg folders (QNAP devices)

* Refactored some code to enable ability to test CoverImage Test. This is a broken test, test.zip is waiting on an issue in NetVips.

* Fixed an issue where Extra might get flagged as special too early, if in a word like Extraordinary

* Cleaned up the regex for the extra issue to be more flexible
This commit is contained in:
Joseph Milazzo 2022-01-12 15:00:00 -08:00 committed by GitHub
parent 6afc17e93e
commit fb71d54fe6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 162 additions and 361 deletions

View file

@ -157,8 +157,6 @@ export class CardDetailLayoutComponent implements OnInit, OnDestroy {
if (this.filterSettings === undefined) {
this.filterSettings = new FilterSettings();
}
this.setupGenreTypeahead();
this.libraryService.getLibrariesForMember().subscribe(libs => {
this.libraries = libs.map(lib => {
@ -168,15 +166,10 @@ export class CardDetailLayoutComponent implements OnInit, OnDestroy {
selected: true,
}
});
this.setupLibraryTypeahead();
this.setupTypeaheads();
});
this.setupCollectionTagTypeahead();
this.setupPersonTypeahead();
this.setupAgeRatingSettings();
this.setupPublicationStatusSettings();
this.setupTagSettings();
this.setupLanguageSettings();
}
ngOnDestroy() {
@ -184,6 +177,17 @@ export class CardDetailLayoutComponent implements OnInit, OnDestroy {
this.onDestory.complete();
}
setupTypeaheads() {
this.setupLibraryTypeahead();
this.setupCollectionTagTypeahead();
this.setupPersonTypeahead();
this.setupAgeRatingSettings();
this.setupPublicationStatusSettings();
this.setupTagSettings();
this.setupLanguageSettings();
this.setupGenreTypeahead();
}
setupFormatTypeahead() {
this.formatSettings.minCharacters = 0;
@ -355,6 +359,7 @@ export class CardDetailLayoutComponent implements OnInit, OnDestroy {
const f = filter.toLowerCase();
return options.filter(m => m.title.toLowerCase() === f);
}
if (this.filterSettings.presetCollectionId > 0) {
this.collectionSettings.fetchFn('').subscribe(tags => {
this.collectionSettings.savedData = tags.filter(item => item.value.id === this.filterSettings.presetCollectionId);
@ -364,6 +369,17 @@ export class CardDetailLayoutComponent implements OnInit, OnDestroy {
}
}
applyPresets() {
// if (this.filterSettings.presetCollectionId > 0) {
// this.collectionSettings.fetchFn('').subscribe(tags => {
// this.collectionSettings.savedData = tags.filter(item => item.value.id === this.filterSettings.presetCollectionId);
// this.filter.collectionTags = this.collectionSettings.savedData.map(item => item.value.id);
// this.resetTypeaheads.next(true);
// });
// }
}
setupPersonTypeahead() {
this.peopleSettings = {};
@ -579,6 +595,8 @@ export class CardDetailLayoutComponent implements OnInit, OnDestroy {
this.readProgressGroup.get('inProgress')?.setValue(true);
this.sortGroup.get('sortField')?.setValue(SortField.SortName);
this.isAscendingSort = true;
// Apply any presets
this.setupTypeaheads();
this.resetTypeaheads.next(true);
this.applyFilter.emit(this.filter);