From f853efa3c180858d69b1d1e71661fae1a0908794 Mon Sep 17 00:00:00 2001 From: "Patrik J. Braun" Date: Tue, 11 May 2021 16:35:19 +0200 Subject: [PATCH] fixing tslint issue --- src/backend/model/threading/MetadataLoader.ts | 9 ++++----- .../app/ui/gallery/grid/grid.gallery.component.ts | 2 -- .../unit/model/threading/DiskMangerWorker.spec.ts | 2 ++ 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/backend/model/threading/MetadataLoader.ts b/src/backend/model/threading/MetadataLoader.ts index 2198e303..65607649 100644 --- a/src/backend/model/threading/MetadataLoader.ts +++ b/src/backend/model/threading/MetadataLoader.ts @@ -217,13 +217,12 @@ export class MetadataLoader { metadata.rating = (parseInt(exif.Rating.value, 10) as any); } if (exif.subject && exif.subject.value && exif.subject.value.length > 0) { - if (metadata.keywords == undefined) { + if (metadata.keywords === undefined) { metadata.keywords = []; } - for (let i = 0; i < exif.subject.value.length; i++) { - const kw = exif.subject.value[i].description; - if (metadata.keywords.indexOf(kw) == -1) { - metadata.keywords.push(kw); + for (const kw of exif.subject.value) { + if (metadata.keywords.indexOf(kw.description) === -1) { + metadata.keywords.push(kw.description); } } } diff --git a/src/frontend/app/ui/gallery/grid/grid.gallery.component.ts b/src/frontend/app/ui/gallery/grid/grid.gallery.component.ts index d019d994..83a03cf7 100644 --- a/src/frontend/app/ui/gallery/grid/grid.gallery.component.ts +++ b/src/frontend/app/ui/gallery/grid/grid.gallery.component.ts @@ -218,8 +218,6 @@ export class GalleryGridComponent implements OnChanges, OnInit, AfterViewInit, O /** * Makes sure that the photo with the given mediaString is visible on the screen - * @param mediaStringId - * @private */ private renderUpToMedia(mediaStringId: string): void { const index = this.media.findIndex((p): boolean => this.queryService.getMediaStringId(p) === mediaStringId); diff --git a/test/backend/unit/model/threading/DiskMangerWorker.spec.ts b/test/backend/unit/model/threading/DiskMangerWorker.spec.ts index 3b7c98ed..4e873932 100644 --- a/test/backend/unit/model/threading/DiskMangerWorker.spec.ts +++ b/test/backend/unit/model/threading/DiskMangerWorker.spec.ts @@ -6,6 +6,8 @@ import {ProjectPath} from '../../../../../src/backend/ProjectPath'; import {Utils} from '../../../../../src/common/Utils'; describe('DiskMangerWorker', () => { + // loading default settings (this might have been changed by other tests + Config.loadSync(); it('should parse metadata', async () => { Config.Server.Media.folder = path.join(__dirname, '/../../../assets');