1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00

Fixing [] glob issue. fixes #621

This commit is contained in:
Patrik J. Braun 2023-10-08 22:32:32 +02:00
parent 43424526ee
commit e1ffeb0173
2 changed files with 8 additions and 6 deletions

View File

@ -161,7 +161,9 @@ export class CoverManager implements IObjectManager {
});
} else {
q.orWhere('directory.path GLOB :path', {
path: DiskMangerWorker.pathFromParent(dir) + '*',
path: DiskMangerWorker.pathFromParent(dir)
// glob escaping. see https://github.com/bpatrik/pigallery2/issues/621
.replaceAll('[', '[[]') + '*',
});
}
})

View File

@ -84,7 +84,7 @@ describe('CoverManager', (sqlHelper: DBTestHelper) => {
const setUpTestGallery = async (): Promise<void> => {
const directory: ParentDirectoryDTO = TestHelper.getDirectoryEntry();
const directory: ParentDirectoryDTO = TestHelper.getDirectoryEntry(null, 'éűáúőóüöÉŰÚŐÓÜÖ[]^[[]]][asd]');
subDir = TestHelper.getDirectoryEntry(directory, 'The Phantom Menace');
subDir2 = TestHelper.getDirectoryEntry(directory, 'Return of the Jedi');
p = TestHelper.getPhotoEntry1(subDir);