Fixes before Release (#2251)

* Removed console.logs

* Removed console.log() from app

* Fixed a bug where when a user adds their own favicon to their folder, the check could fail as the www. wasn't being stripped.

* Don't fail series metadata update if we can't cleanup due to another update taking place (common with komf)
This commit is contained in:
Joe Milazzo 2023-09-02 10:02:25 -07:00 committed by GitHub
parent d7b97d2d93
commit 1895a83033
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 13 additions and 83 deletions

View File

@ -420,7 +420,7 @@ public class ImageService : IImageService
public static string GetWebLinkFormat(string url, EncodeFormat encodeFormat)
{
return $"{new Uri(url).Host}{encodeFormat.GetExtension()}";
return $"{new Uri(url).Host.Replace("www.", string.Empty)}{encodeFormat.GetExtension()}";
}

View File

@ -226,7 +226,15 @@ public class SeriesService : ISeriesService
await _unitOfWork.CommitAsync();
// Trigger code to cleanup tags, collections, people, etc
await _taskScheduler.CleanupDbEntries();
try
{
await _taskScheduler.CleanupDbEntries();
}
catch (Exception ex)
{
_logger.LogError(ex, "There was an issue cleaning up DB entries. This may happen if Komf is spamming updates. Nightly cleanup will work");
}
if (updateSeriesMetadataDto.CollectionTags == null) return true;
foreach (var tag in updateSeriesMetadataDto.CollectionTags)

View File

@ -25,53 +25,10 @@ import {FilterStatement} from "../_models/metadata/v2/filter-statement";
export class MetadataService {
baseUrl = environment.apiUrl;
private currentThemeSource = new ReplaySubject<SeriesFilterV2>(1);
private ageRatingTypes: {[key: number]: string} | undefined = undefined;
private validLanguages: Array<Language> = [];
constructor(private httpClient: HttpClient, private router: Router) { }
// applyFilter(page: Array<any>, filter: FilterField, comparison: FilterComparison, value: string) {
// const dto: SeriesFilterV2 = {
// statements: [this.createDefaultFilterStatement(filter, comparison, value + '')],
// combination: FilterCombination.Or,
// limitTo: 0
// };
// //
// // console.log('navigating to: ', this.filterUtilityService.urlFromFilterV2(page.join('/'), dto));
// // this.router.navigateByUrl(this.filterUtilityService.urlFromFilterV2(page.join('/'), dto));
//
// // Creates a temp name for the filter
// this.httpClient.post<string>(this.baseUrl + 'filter/create-temp', dto, TextResonse).pipe(map(name => {
// dto.name = name;
// }), switchMap((_) => {
// let params: any = {};
// params['filterName'] = dto.name;
// return this.router.navigate(page, {queryParams: params});
// })).subscribe();
//
// }
// getFilter(filterName: string) {
// return this.httpClient.get<SeriesFilterV2>(this.baseUrl + 'filter?name=' + filterName);
// }
// getAgeRating(ageRating: AgeRating) {
// if (this.ageRatingTypes != undefined && this.ageRatingTypes.hasOwnProperty(ageRating)) {
// return of(this.ageRatingTypes[ageRating]);
// }
// return this.httpClient.get<string>(this.baseUrl + 'series/age-rating?ageRating=' + ageRating, TextResonse).pipe(map(ratingString => {
// if (this.ageRatingTypes === undefined) {
// this.ageRatingTypes = {};
// }
//
// this.ageRatingTypes[ageRating] = ratingString;
// return this.ageRatingTypes[ageRating];
// }));
// }
getAllAgeRatings(libraries?: Array<number>) {
let method = 'metadata/age-ratings'
if (libraries != undefined && libraries.length > 0) {

View File

@ -115,14 +115,12 @@ export class CardDetailLayoutComponent implements OnInit, OnChanges {
}
ngOnInit(): void {
console.log('[card-detail-layout] ngOnInit')
if (this.trackByIdentity === undefined) {
this.trackByIdentity = (_: number, item: any) => `${this.header}_${this.updateApplied}_${item?.libraryId}`;
}
if (this.filterSettings === undefined) {
this.filterSettings = new FilterSettings();
console.log('[card-detail-layout] creating blank FilterSettings');
this.cdRef.markForCheck();
}
@ -180,7 +178,6 @@ export class CardDetailLayoutComponent implements OnInit, OnChanges {
this.applyFilter.emit(event);
this.updateApplied++;
this.filter = event.filterV2;
console.log('[card-detail-layout] apply filter')
this.cdRef.markForCheck();
}

View File

@ -135,11 +135,6 @@ export class LibraryDetailComponent implements OnInit {
}
}
get Debug() {
console.log('rendered section ');
return 0;
}
constructor(private route: ActivatedRoute, private router: Router, private seriesService: SeriesService,
private libraryService: LibraryService, private titleService: Title, private actionFactoryService: ActionFactoryService,
private actionService: ActionService, public bulkSelectionService: BulkSelectionService, private hubService: MessageHubService,

View File

@ -196,7 +196,7 @@ export class InfiniteScrollerComponent implements OnInit, OnChanges, OnDestroy {
* gets promoted to fullscreen.
*/
initScrollHandler() {
console.log('Setting up Scroll handler on ', this.isFullscreenMode ? this.readerElemRef.nativeElement : this.document.body);
//console.log('Setting up Scroll handler on ', this.isFullscreenMode ? this.readerElemRef.nativeElement : this.document.body);
fromEvent(this.isFullscreenMode ? this.readerElemRef.nativeElement : this.document.body, 'scroll')
.pipe(debounceTime(20), takeUntilDestroyed(this.destroyRef))
.subscribe((event) => this.handleScrollEvent(event));

View File

@ -1376,7 +1376,6 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {
// This will update the value for value except when in webtoon due to how the webtoon reader
// responds to page changes
if (this.readerMode !== ReaderMode.Webtoon) {
console.log('Setting Page Number as slider drag occurred');
this.setPageNum(context.value);
}
}
@ -1390,7 +1389,6 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {
this.pagingDirectionSubject.next(PAGING_DIRECTION.BACKWARDS);
}
console.log('Setting Page Number as slider page update occurred');
this.setPageNum(this.adjustPagesForDoubleRenderer(page));
this.refreshSlider.emit();
this.goToPageEvent.next(this.pageNum);
@ -1477,7 +1475,6 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {
this.pagingDirectionSubject.next(PAGING_DIRECTION.BACKWARDS);
}
console.log('Setting Page Number as goto page');
this.setPageNum(this.adjustPagesForDoubleRenderer(page));
this.goToPageEvent.next(page);
this.render();
@ -1561,7 +1558,6 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {
}
handleWebtoonPageChange(updatedPageNum: number) {
console.log('Setting Page Number as webtoon page changed');
this.setPageNum(updatedPageNum);
}

View File

@ -68,29 +68,24 @@ export class MetadataBuilderComponent implements OnInit {
];
ngOnInit() {
console.log('[builder] ngOnInit');
this.formGroup.addControl('comparison', new FormControl<FilterCombination>(this.filter?.combination || FilterCombination.Or, []));
this.formGroup.valueChanges.pipe(distinctUntilChanged(), takeUntilDestroyed(this.destroyRef), tap(values => {
this.filter.combination = parseInt(this.formGroup.get('comparison')?.value, 10) as FilterCombination;
console.log('[builder] emitting filter from comparison change');
this.update.emit(this.filter);
})).subscribe();
}
addFilter() {
console.log('[builder] Adding Filter')
this.filter.statements = [this.metadataService.createDefaultFilterStatement(), ...this.filter.statements];
this.cdRef.markForCheck();
}
removeFilter(index: number) {
console.log('[builder] Removing filter')
this.filter.statements = this.filter.statements.slice(0, index).concat(this.filter.statements.slice(index + 1))
this.cdRef.markForCheck();
}
updateFilter(index: number, filterStmt: FilterStatement) {
console.log('[builder] updating filter: ', this.filter.statements);
this.metadataService.updateFilter(this.filter.statements, index, filterStmt);
this.update.emit(this.filter);
}

View File

@ -123,13 +123,12 @@ export class MetadataFilterRowComponent implements OnInit {
private readonly collectionTagService: CollectionTagService) {}
ngOnInit() {
console.log('[ngOnInit] creating stmt (' + this.index + '): ', this.preset)
this.formGroup.addControl('input', new FormControl<FilterField>(FilterField.SeriesName, []));
this.formGroup.get('input')?.valueChanges.pipe(distinctUntilChanged(), takeUntilDestroyed(this.destroyRef)).subscribe((val: string) => this.handleFieldChange(val));
this.populateFromPreset();
this.formGroup.get('filterValue')?.valueChanges.pipe(takeUntilDestroyed(this.destroyRef), tap(v => console.log('filterValue: ', v))).subscribe();
this.formGroup.get('filterValue')?.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe();
// Dropdown dynamic option selection
this.dropdownOptions$ = this.formGroup.get('input')!.valueChanges.pipe(
@ -156,9 +155,7 @@ export class MetadataFilterRowComponent implements OnInit {
stmt.value = stmt.value + '';
}
console.log('Trying to update parent with new stmt: ', stmt.value);
if (!stmt.value && stmt.field !== FilterField.SeriesName) return;
console.log('updating parent with new statement: ', stmt.value)
this.filterStatement.emit(stmt);
});
@ -170,7 +167,6 @@ export class MetadataFilterRowComponent implements OnInit {
populateFromPreset() {
const val = this.preset.value === "undefined" || !this.preset.value ? '' : this.preset.value;
console.log('populating preset: ', val);
this.formGroup.get('comparison')?.patchValue(this.preset.comparison);
this.formGroup.get('input')?.patchValue(this.preset.field);
@ -178,7 +174,6 @@ export class MetadataFilterRowComponent implements OnInit {
this.formGroup.get('filterValue')?.patchValue(val);
} else if (DropdownFields.includes(this.preset.field)) {
if (this.MultipleDropdownAllowed || val.includes(',')) {
console.log('setting multiple values: ', val.split(',').map(d => parseInt(d, 10)));
this.formGroup.get('filterValue')?.patchValue(val.split(',').map(d => parseInt(d, 10)));
} else {
if (this.preset.field === FilterField.Languages) {
@ -253,7 +248,6 @@ export class MetadataFilterRowComponent implements OnInit {
handleFieldChange(val: string) {
const inputVal = parseInt(val, 10) as FilterField;
console.log('HandleFieldChange: ', val);
if (StringFields.includes(inputVal)) {
this.validComparisons$.next(StringComparisons);
@ -261,7 +255,6 @@ export class MetadataFilterRowComponent implements OnInit {
if (this.loaded) {
this.formGroup.get('filterValue')?.patchValue('');
console.log('setting filterValue to empty string', this.formGroup.get('filterValue')?.value)
}
return;
}

View File

@ -76,7 +76,6 @@ export class MetadataFilterComponent implements OnInit {
allFilterFields = allFields;
handleFilters(filter: SeriesFilterV2) {
console.log('[metadata-filter] updating filter');
this.filterV2 = filter;
}
@ -87,7 +86,6 @@ export class MetadataFilterComponent implements OnInit {
constructor(public toggleService: ToggleService) {}
ngOnInit(): void {
console.log('[metadata-filter] ngOnInit')
if (this.filterSettings === undefined) {
this.filterSettings = new FilterSettings();
this.cdRef.markForCheck();
@ -139,7 +137,6 @@ export class MetadataFilterComponent implements OnInit {
loadFromPresetsAndSetup() {
this.fullyLoaded = false;
console.log('[metadata-filter] loading from preset and setting up');
this.filterV2 = this.deepClone(this.filterSettings.presetsV2);
this.sortGroup = new FormGroup({
@ -148,7 +145,6 @@ export class MetadataFilterComponent implements OnInit {
});
this.sortGroup.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
console.log('[metadata-filter] sortGroup value change');
if (this.filterV2?.sortOptions === null) {
this.filterV2.sortOptions = {
isAscending: this.isAscendingSort,
@ -176,7 +172,6 @@ export class MetadataFilterComponent implements OnInit {
}
this.filterV2!.sortOptions!.isAscending = this.isAscendingSort;
console.log('[metadata-filter] updated filter sort order')
}
clear() {

View File

@ -509,11 +509,8 @@ export class TypeaheadComponent implements OnInit {
// Check if this new option will interfere with any existing ones not shown
if (typeof this.settings.compareFnForAdd == 'function') {
console.log('filtered options: ', this.optionSelection.selected());
const willDuplicateExist = this.settings.compareFnForAdd(this.optionSelection.selected(), inputText);
console.log('duplicate check: ', willDuplicateExist);
if (willDuplicateExist.length > 0) {
console.log("can't show add, duplicates will exist");
return;
}
}
@ -521,10 +518,7 @@ export class TypeaheadComponent implements OnInit {
if (typeof this.settings.compareFn == 'function') {
// The problem here is that compareFn can report that duplicate will exist as it does contains not match
const matches = this.settings.compareFn(options, inputText);
console.log('matches for ', inputText, ': ', matches);
console.log('matches include input string: ', matches.includes(this.settings.addTransformFn(inputText)));
if (matches.length > 0 && matches.includes(this.settings.addTransformFn(inputText))) {
console.log("can't show add, there are still ");
return;
}
}

View File

@ -7,7 +7,7 @@
"name": "GPL-3.0",
"url": "https://github.com/Kareadita/Kavita/blob/develop/LICENSE"
},
"version": "0.7.7.17"
"version": "0.7.7.19"
},
"servers": [
{