From 0b5d388af213680d0def2c03d3c8814c3e2ceaa2 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch
Date: Fri, 22 Dec 2023 04:35:49 +0100 Subject: WIP: FS to DB sync --- public/gallery.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'public') diff --git a/public/gallery.js b/public/gallery.js index d97a55a..ee11858 100644 --- a/public/gallery.js +++ b/public/gallery.js @@ -14,6 +14,7 @@ let BrowseModel = { path: undefined, subdirectories: [], entries: [], + collator: new Intl.Collator(undefined, {numeric: true}), async reload(path) { if (this.path !== path) { @@ -24,7 +25,8 @@ let BrowseModel = { let resp = await call('browse', {path: path}) this.subdirectories = resp.subdirectories - this.entries = resp.entries + this.entries = resp.entries.sort((a, b) => + this.collator.compare(a.name, b.name)) }, joinPath(parent, child) { -- cgit v1.2.3-70-g09d2