diff --git a/backend/model/sql/GalleryManager.ts b/backend/model/sql/GalleryManager.ts index 5bfe15d2..0cf83b4c 100644 --- a/backend/model/sql/GalleryManager.ts +++ b/backend/model/sql/GalleryManager.ts @@ -36,7 +36,7 @@ export class GalleryManager implements IGalleryManager, ISQLGalleryManager { .getOne(); - if (dir && dir.lastScanned == null) { + if (dir && dir.lastScanned != null) { //If it seems that the content did not changed, do not work on it if (knownLastModified && knownLastScanned && lastModified == knownLastModified && @@ -53,7 +53,6 @@ export class GalleryManager implements IGalleryManager, ISQLGalleryManager { if (dir.photos) { for (let i = 0; i < dir.photos.length; i++) { dir.photos[i].directory = dir; - //PhotoMetadataEntity.open(dir.photos[i].metadata); dir.photos[i].readyThumbnails = []; dir.photos[i].readyIcon = false; } @@ -84,6 +83,7 @@ export class GalleryManager implements IGalleryManager, ISQLGalleryManager { return this.indexDirectory(relativeDirectoryName); } + //not indexed since a while, index it in a lazy manner if ((Date.now() - dir.lastScanned > Config.Server.indexing.cachedFolderTimeout && Config.Server.indexing.reIndexingSensitivity >= ReIndexingSensitivity.medium) || Config.Server.indexing.reIndexingSensitivity >= ReIndexingSensitivity.high) { @@ -96,6 +96,8 @@ export class GalleryManager implements IGalleryManager, ISQLGalleryManager { } + + //never scanned (deep indexed), do it and return with it return this.indexDirectory(relativeDirectoryName); diff --git a/backend/model/sql/SQLConnection.ts b/backend/model/sql/SQLConnection.ts index 6d07e504..c105d64d 100644 --- a/backend/model/sql/SQLConnection.ts +++ b/backend/model/sql/SQLConnection.ts @@ -33,7 +33,7 @@ export class SQLConnection { SharingEntity ]; options.synchronize = true; - options.logging = "all"; + // options.logging = "all"; this.connection = await createConnection(options); } return this.connection; diff --git a/frontend/app/gallery/cache.gallery.service.ts b/frontend/app/gallery/cache.gallery.service.ts index e2dc5591..1ad2a7e9 100644 --- a/frontend/app/gallery/cache.gallery.service.ts +++ b/frontend/app/gallery/cache.gallery.service.ts @@ -123,9 +123,9 @@ export class GalleryCacheService { localStorage.setItem(key, JSON.stringify(directory)); directory.directories.forEach((dir: DirectoryDTO) => { - let name = Utils.concatUrls(dir.path, dir.name); - if (localStorage.getItem(name) == null) { //don't override existing - localStorage.setItem(Utils.concatUrls(dir.path, dir.name), JSON.stringify(dir)); + const sub_key = GalleryCacheService.CONTENT_PREFIX + Utils.concatUrls(dir.path, dir.name); + if (localStorage.getItem(sub_key) == null) { //don't override existing + localStorage.setItem(sub_key, JSON.stringify(dir)); } }); diff --git a/frontend/app/settings/thumbnail/thumbanil.settings.component.html b/frontend/app/settings/thumbnail/thumbanil.settings.component.html index adcef038..6dbcee58 100644 --- a/frontend/app/settings/thumbnail/thumbanil.settings.component.html +++ b/frontend/app/settings/thumbnail/thumbanil.settings.component.html @@ -29,10 +29,10 @@
- +
Thumbnails will be saved in this folder. Write access is required diff --git a/package.json b/package.json index 285f0e92..843c88bb 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "ts-exif-parser": "0.1.23", "ts-node-iptc": "1.0.9", "typeconfig": "1.0.5", - "typeorm": "0.1.9", + "typeorm": "0.1.8", "winston": "2.4.0" }, "devDependencies": { diff --git a/test/backend/integration/model/sql/typeorm.ts b/test/backend/integration/model/sql/typeorm.ts index 43753fa4..9a9c7578 100644 --- a/test/backend/integration/model/sql/typeorm.ts +++ b/test/backend/integration/model/sql/typeorm.ts @@ -190,9 +190,7 @@ describe('Typeorm integration', () => { }); it('should open and close connection twice with photo added ', async () => { - console.log("start-------------------------------------"); let conn = await SQLConnection.getConnection(); - console.log("opnenn-------------------------------------"); const dir = await conn.getRepository(DirectoryEntity).save(getDir()); let dir2 = getDir(); dir2.parent = dir;