From 0d519055d5a20861953a1d8dc95c275ab8b46b1c Mon Sep 17 00:00:00 2001 From: "Patrik J. Braun" Date: Sat, 5 Feb 2022 13:16:16 +0100 Subject: [PATCH] Fixing dir preview sorting algorithm. --- src/backend/model/database/sql/PreviewManager.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/model/database/sql/PreviewManager.ts b/src/backend/model/database/sql/PreviewManager.ts index 36f07977..fc19a9d3 100644 --- a/src/backend/model/database/sql/PreviewManager.ts +++ b/src/backend/model/database/sql/PreviewManager.ts @@ -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 }