turn off auto book search by default, only trigger on search tab (#3127)
This commit is contained in:
@@ -149,7 +149,7 @@ public class AppSettingService {
|
||||
true
|
||||
)
|
||||
);
|
||||
builder.autoBookSearch(Boolean.parseBoolean(settingPersistenceHelper.getOrCreateSetting(AppSettingKey.AUTO_BOOK_SEARCH, "true")));
|
||||
builder.autoBookSearch(Boolean.parseBoolean(settingPersistenceHelper.getOrCreateSetting(AppSettingKey.AUTO_BOOK_SEARCH, "false")));
|
||||
builder.uploadPattern(settingPersistenceHelper.getOrCreateSetting(AppSettingKey.UPLOAD_FILE_PATTERN, "{authors}/<{series}/><{seriesIndex}. >/{title}/{title}< - {authors}>< ({year})>"));
|
||||
builder.similarBookRecommendation(Boolean.parseBoolean(settingPersistenceHelper.getOrCreateSetting(AppSettingKey.SIMILAR_BOOK_RECOMMENDATION, "true")));
|
||||
builder.opdsServerEnabled(Boolean.parseBoolean(settingPersistenceHelper.getOrCreateSetting(AppSettingKey.OPDS_SERVER_ENABLED, "false")));
|
||||
|
||||
+1
@@ -0,0 +1 @@
|
||||
UPDATE app_settings SET val = 'false' WHERE name = 'auto_book_search';
|
||||
+1
-1
@@ -60,7 +60,7 @@
|
||||
}
|
||||
@if (admin || canEditMetadata) {
|
||||
<p-tabpanel value="match">
|
||||
<app-metadata-searcher [book$]="book$"></app-metadata-searcher>
|
||||
<app-metadata-searcher [book$]="book$" [isActiveTab]="tab === 'match'"></app-metadata-searcher>
|
||||
</p-tabpanel>
|
||||
}
|
||||
@if ((admin || canEditMetadata) && !isPhysical) {
|
||||
|
||||
+16
-3
@@ -1,4 +1,4 @@
|
||||
import {Component, inject, Input, OnDestroy, OnInit} from '@angular/core';
|
||||
import {Component, inject, Input, OnChanges, OnDestroy, OnInit, SimpleChanges} from '@angular/core';
|
||||
import {FormBuilder, FormGroup, FormsModule, ReactiveFormsModule} from '@angular/forms';
|
||||
import {Button} from 'primeng/button';
|
||||
import {InputText} from 'primeng/inputtext';
|
||||
@@ -35,7 +35,7 @@ import {TranslocoDirective} from '@jsverse/transloco';
|
||||
],
|
||||
standalone: true
|
||||
})
|
||||
export class MetadataSearcherComponent implements OnInit, OnDestroy {
|
||||
export class MetadataSearcherComponent implements OnInit, OnDestroy, OnChanges {
|
||||
form: FormGroup;
|
||||
providers: string[] = [];
|
||||
allFetchedMetadata: BookMetadata[] = [];
|
||||
@@ -44,6 +44,7 @@ export class MetadataSearcherComponent implements OnInit, OnDestroy {
|
||||
searchTriggered = false;
|
||||
|
||||
@Input() book$!: Observable<Book | null>;
|
||||
@Input() isActiveTab: boolean = false;
|
||||
|
||||
selectedFetchedMetadata$ = new BehaviorSubject<BookMetadata | null>(null);
|
||||
detailLoading = false;
|
||||
@@ -66,6 +67,7 @@ export class MetadataSearcherComponent implements OnInit, OnDestroy {
|
||||
|
||||
private metadataByProvider: Map<string, BookMetadata[]> = new Map();
|
||||
private providerCompletionStatus: Map<string, boolean> = new Map();
|
||||
private pendingAutoSearch = false;
|
||||
|
||||
constructor() {
|
||||
this.form = this.formBuilder.group({
|
||||
@@ -76,6 +78,13 @@ export class MetadataSearcherComponent implements OnInit, OnDestroy {
|
||||
});
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
if (changes['isActiveTab']?.currentValue && this.pendingAutoSearch) {
|
||||
this.pendingAutoSearch = false;
|
||||
this.onSubmit();
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.subscription.add(
|
||||
this.appSettings$
|
||||
@@ -117,7 +126,11 @@ export class MetadataSearcherComponent implements OnInit, OnDestroy {
|
||||
if (bookChanged) {
|
||||
this.resetFormFromBook(book!);
|
||||
if (settings!.autoBookSearch) {
|
||||
this.onSubmit();
|
||||
if (this.isActiveTab) {
|
||||
this.onSubmit();
|
||||
} else {
|
||||
this.pendingAutoSearch = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.updateFormFromBook(book!);
|
||||
|
||||
Reference in New Issue
Block a user