mirror of
https://github.com/xuthus83/pigallery2.git
synced 2025-01-14 14:43:17 +08:00
Fixing recursive random photo generation Fixes: #154
This commit is contained in:
parent
e9468c154a
commit
c06a2b887e
@ -16,6 +16,7 @@ import {VideoDTO} from '../../common/entities/VideoDTO';
|
|||||||
import {Utils} from '../../common/Utils';
|
import {Utils} from '../../common/Utils';
|
||||||
import {QueryParams} from '../../common/QueryParams';
|
import {QueryParams} from '../../common/QueryParams';
|
||||||
import {VideoProcessing} from '../model/fileprocessing/VideoProcessing';
|
import {VideoProcessing} from '../model/fileprocessing/VideoProcessing';
|
||||||
|
import {DiskMangerWorker} from '../model/threading/DiskMangerWorker';
|
||||||
|
|
||||||
|
|
||||||
export class GalleryMWs {
|
export class GalleryMWs {
|
||||||
@ -120,7 +121,7 @@ export class GalleryMWs {
|
|||||||
try {
|
try {
|
||||||
const query: RandomQuery = {};
|
const query: RandomQuery = {};
|
||||||
if (req.query.directory) {
|
if (req.query.directory) {
|
||||||
query.directory = req.query.directory;
|
query.directory = DiskMangerWorker.normalizeDirPath(req.query.directory);
|
||||||
}
|
}
|
||||||
if (req.query.recursive === 'true') {
|
if (req.query.recursive === 'true') {
|
||||||
query.recursive = true;
|
query.recursive = true;
|
||||||
|
@ -100,7 +100,7 @@ export class GalleryManager implements IGalleryManager, ISQLGalleryManager {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (queryFilter.recursive) {
|
if (queryFilter.recursive) {
|
||||||
qb.orWhere('directory.name LIKE :text COLLATE utf8_general_ci', {text: '%' + queryFilter.directory + '%'});
|
qb.orWhere('directory.path LIKE :text COLLATE utf8_general_ci', {text: queryFilter.directory + '%'});
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user