shithub: hell

Download patch

ref: 63ac58e166f42011ad4300eae48ebfeb33fcd63e
parent: fbfefb8a8ff1f16001604332a22086c7c11c7dcf
author: penny <penny@limitedideas.org>
date: Tue Sep 30 18:53:45 EDT 2025

some config/download tweaks

--- a/config.go
+++ b/config.go
@@ -67,8 +67,8 @@
 		Apidelay: 2,
 		Save_Location: "~/Downloads",
 		Browser: "xdg-open '%s'",
-		ImageViewer: "xdg-open %s",
-		MediaImport: "xdg-open %s",
+		ImageViewer: "xdg-open '%s'",
+		MediaImport: "xdg-open '%s'",
 	}
 	return *prefs
 }
--- a/filehandler.go
+++ b/filehandler.go
@@ -8,7 +8,6 @@
 	"os"
 	"os/exec"
 	"path"
-	"strings"
 
 	"codeberg.org/penny64/hellclient-go-mastodon"
 	"github.com/google/shlex"
@@ -28,15 +27,18 @@
 	return
 }
 func (hc *Hellclient) previewPostImages(target *mastodon.Status, commandstring string) (err error) {
+	//Let go of the lock while we wait for return
+	hc.unlock()
 	_, pathnames, err := downloadPostImages(target)
 
 	if len(pathnames) == 0 {
 		//We tolerate failing to download some items but if we have none then error out
+		hc.lock()
 		return
 	}
-	//Let go of the lock while we wait for return
-	hc.unlock()
-	openItemInOS(commandstring, strings.Join(pathnames, " "))
+	for _, path := range pathnames {
+		openItemInOS(commandstring, path)
+	}
 	hc.lock()
 	return
 
--