aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.go18
-rw-r--r--public/gallery.js4
2 files changed, 17 insertions, 5 deletions
diff --git a/main.go b/main.go
index 64cf26c..d1fdbb9 100644
--- a/main.go
+++ b/main.go
@@ -1037,7 +1037,12 @@ func syncPostProcess(c *syncContext, info syncFileInfo) error {
switch {
case info.err != nil:
// * → error
- return info.err
+ if ee, ok := info.err.(*exec.ExitError); ok {
+ syncPrintf(c, "%s: %s", info.fsPath, ee.Stderr)
+ } else {
+ return info.err
+ }
+ fallthrough
case info.sha1 == "":
// 0 → 0
@@ -1696,10 +1701,15 @@ func cmdThumbnail(args []string) error {
defer taskSemaphore.release()
defer wg.Done()
if err := makeThumbnailFor(sha1); err != nil {
- cancel(err)
- } else {
- pb.Step()
+ if ee, ok := err.(*exec.ExitError); ok {
+ pb.Stop()
+ log.Printf("%s: %s\n", sha1, ee.Stderr)
+ pb.Update()
+ } else {
+ cancel(err)
+ }
}
+ pb.Step()
}(sha1)
}
wg.Wait()
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) {