ref: 6cc3988782312323f3d6453c8bc64f33f3c4d5ba
parent: 79dc9d4959e4d5b93a72a10e282237e00385b59c
author: penny <penny@limitedideas.org>
date: Mon Aug 11 13:52:28 EDT 2025
Image preview unlocks the mutex while waiting
--- a/filehandler.go
+++ b/filehandler.go
@@ -13,7 +13,7 @@
"github.com/mattn/go-mastodon"
)
-func previewPostImages(target *mastodon.Status, commandstring string) (err error) {+func (hc *Hellclient) previewPostImages(target *mastodon.Status, commandstring string) (err error) {var command string
@@ -41,7 +41,10 @@
cmd := exec.Command(command, args...)
cmd.Stdout = os.Stdout
+ //Let go of the lock while we wait for return
+ hc.unlock()
err = cmd.Run()
+ hc.lock()
return
}
--- a/main.go
+++ b/main.go
@@ -177,12 +177,12 @@
cmd := exec.Command("open", url, "-a", "Eldritch Café")cmd.Run()
case "preview":
- err := previewPostImages(postItem, "open -W -a \"Quick Look\"")
+ err := hc.previewPostImages(postItem, "open -W -a \"Quick Look\"")
if err != nil { fmt.Printf("Image preview failed: %v\n", err)}
case "import":
- err := previewPostImages(postItem, "shortcuts run \"media collector\" --input-path")
+ err := hc.previewPostImages(postItem, "shortcuts run \"media collector\" --input-path")
if err != nil { fmt.Printf("Image preview failed: %v\n", err)}
--
⑨