1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2025-01-14 14:43:17 +08:00

Fixing dir preview sorting algorithm.

This commit is contained in:
Patrik J. Braun 2022-02-05 13:16:16 +01:00
parent e53be48155
commit 0d519055d5

View File

@ -161,9 +161,9 @@ export class PreviewManager implements IPreviewManager {
}
}));
if (Config.Server.Database.type === DatabaseType.mysql) {
query.orderBy('CHAR_LENGTH(directory.path)', 'DESC'); // shorter the path, its higher up in the hierarchy
query.orderBy('CHAR_LENGTH(directory.path)', 'ASC'); // shorter the path, its higher up in the hierarchy
} else {
query.orderBy('LENGTH(directory.path)', 'DESC'); // shorter the path, its higher up in the hierarchy
query.orderBy('LENGTH(directory.path)', 'ASC'); // shorter the path, its higher up in the hierarchy
}