mirror of
https://github.com/xuthus83/pigallery2.git
synced 2024-11-03 21:04:03 +08:00
Adding preview from sub dirs to freshly scanned photos: #31
This commit is contained in:
parent
94d57cf6a1
commit
d53af51be2
@ -15,6 +15,5 @@ before_install:
|
||||
- google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost &
|
||||
install:
|
||||
- npm ci
|
||||
- npm run lint
|
||||
- npm run build
|
||||
after_success: npm run coverage
|
||||
|
@ -60,7 +60,13 @@ export class GalleryManager implements IGalleryManager, ISQLGalleryManager {
|
||||
if (dir.lastModified !== lastModified) {
|
||||
Logger.silly(LOG_TAG, 'Reindexing reason: lastModified mismatch: known: '
|
||||
+ dir.lastModified + ', current:' + lastModified);
|
||||
return ObjectManagers.getInstance().IndexingManager.indexDirectory(relativeDirectoryName);
|
||||
const ret = await ObjectManagers.getInstance().IndexingManager.indexDirectory(relativeDirectoryName);
|
||||
for (const subDir of ret.directories) {
|
||||
if (!subDir.preview) { // if sub directories does not have photos, so cannot show a preview, try get one from DB
|
||||
await this.fillPreviewFromSubDir(connection, subDir);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -213,7 +219,7 @@ export class GalleryManager implements IGalleryManager, ISQLGalleryManager {
|
||||
return await query.getOne();
|
||||
}
|
||||
|
||||
protected async fillPreviewFromSubDir(connection: Connection, dir: DirectoryEntity): Promise<void> {
|
||||
protected async fillPreviewFromSubDir(connection: Connection, dir: DirectoryDTO): Promise<void> {
|
||||
dir.media = [];
|
||||
const query = connection
|
||||
.getRepository(MediaEntity)
|
||||
|
Loading…
Reference in New Issue
Block a user