···1818 {
1919 "name": "instance_url",
2020 "title": "Instance URL",
2121- "description": "The cobalt.tools instance to use. Please make sure that the instance you choose is trustworthy.",
2121+ "description": "The cobalt.tools instance to use. Please make sure that the instance you choose is trustworthy, as malicious instances can be used to get info about your device.",
2222 "type": "textfield",
2323 "default": "https://dl.woof.monster",
2424- "placeholder": "https://cobalt.sudoman.ia",
2424+ "placeholder": "https://dl.woof.monster",
2525 "required": false
2626 },
2727 {
···4949 {
5050 "name": "default_folder",
5151 "title": "Download media to",
5252- "description": "The default folder to save media. This does not apply to media that can only be downloaded via the web browser.",
5252+ "description": "The default folder to save media.",
5353 "type": "directory",
5454 "required": true
5555+ },
5656+ {
5757+ "name": "show_in_file_manager",
5858+ "label": "Show media in file manager when download finishes",
5959+ "description": "Shows where the media has been saved in the file manager",
6060+ "type": "checkbox",
6161+ "default": true,
6262+ "required": false
5563 }
5664 ],
5765 "dependencies": {
+33-12
src/download-media.tsx
···5252 const media = await fetch(res.url);
5353 await pipeline(Readable.fromWeb(media.body), fs.createWriteStream(`${values.destination}/${res.filename}`));
54545555- switch (os.type()) {
5656- case "Darwin":
5757- await showHUD("Opened in Finder");
5858- break;
5959- case "Windows_NT":
6060- await showHUD("Opened in File Explorer");
6161- break;
5555+ if (preferences.show_in_file_manager) {
5656+ switch (os.type()) {
5757+ case "Darwin":
5858+ await showHUD("Opened in Finder");
5959+ break;
6060+ case "Windows_NT":
6161+ await showHUD("Opened in File Explorer");
6262+ break;
6363+ }
6464+ await showInFinder(`${values.destination}/${res.filename}`);
6565+ await closeMainWindow({
6666+ // showHUD can close the main window, making this redundant, but
6767+ // we still needed to open the file manager, so we fully close
6868+ // it here
6969+ clearRootSearch: true,
7070+ popToRootType: PopToRootType.Immediate,
7171+ });
7272+ } else {
7373+ await closeMainWindow();
7474+ showToast({
7575+ // showHUD does not allow subtitles, so we close the main window
7676+ // and show a "toast" instead.
7777+ title: "Media successfully downloaded",
7878+ message: res.filename,
7979+ style: Toast.Style.Success,
8080+ });
8181+ await closeMainWindow({
8282+ // we still needed to show the toast, now that we have, we can
8383+ // fully close the main window
8484+ clearRootSearch: true,
8585+ popToRootType: PopToRootType.Immediate,
8686+ });
6287 }
6363- await showInFinder(`${values.destination}/${res.filename}`);
6464- await closeMainWindow({
6565- clearRootSearch: true,
6666- popToRootType: PopToRootType.Immediate,
6767- });
8888+6889 break;
6990 }
7091 case "error":