DLSystem don't crash on failure

This commit is contained in:
2022-09-18 22:42:39 +00:00
parent 0d295198df
commit 07aecdd9ed

View File

@@ -20,14 +20,18 @@
// TODO put active dl processes in a map and // TODO put active dl processes in a map and
// don't start new ones when re-processing // don't start new ones when re-processing
(localFunction :Void downloadMp3 [] (localFunction :Void downloadMp3 []
(ui.displayMessage "downloading $url as $basename") (try
``` {
youtube-dl -x --audio-format mp3 -o $o $url (ui.displayMessage "downloading $url as $basename")
``` ```
(ui.displayMessage "done downloading $basename") youtube-dl -x --audio-format mp3 -o $o $url
```
(addFiles archive e ["${basename}.mp3"]) (ui.displayMessage "done downloading $basename")
(addTags archive e ["dlProcessed"]))
(addFiles archive e ["${basename}.mp3"])
(addTags archive e ["dlProcessed"]
}
(catch [e] (ui.displayMessage "failed downloading $basename"))))
(#if target.threaded (#if target.threaded
(Thread.create downloadMp3) (Thread.create downloadMp3)
{ {