From a3ced86214463544a55c7443a65f98c20c942f87 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Fri, 24 Oct 2025 17:37:34 +0200 Subject: [PATCH] don't create homework folder before it's necessary (#2264) --- dots/.config/quickshell/ii/modules/sidebarLeft/Anime.qml | 9 --------- .../ii/modules/sidebarLeft/anime/BooruImage.qml | 7 ++++--- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/dots/.config/quickshell/ii/modules/sidebarLeft/Anime.qml b/dots/.config/quickshell/ii/modules/sidebarLeft/Anime.qml index cab251cb8..c673f6304 100644 --- a/dots/.config/quickshell/ii/modules/sidebarLeft/Anime.qml +++ b/dots/.config/quickshell/ii/modules/sidebarLeft/Anime.qml @@ -23,15 +23,6 @@ Item { property var suggestionQuery: "" property var suggestionList: [] - Connections { - target: Config - function onReadyChanged() { - if (Config.options.policies.weeb !== 0) { - Quickshell.execDetached(["bash", "-c", `mkdir -p '${root.downloadPath}' && mkdir -p '${root.nsfwPath}'`]) - } - } - } - Connections { target: Booru function onTagSuggestion(query, suggestions) { diff --git a/dots/.config/quickshell/ii/modules/sidebarLeft/anime/BooruImage.qml b/dots/.config/quickshell/ii/modules/sidebarLeft/anime/BooruImage.qml index 262321999..99f6f1ab3 100644 --- a/dots/.config/quickshell/ii/modules/sidebarLeft/anime/BooruImage.qml +++ b/dots/.config/quickshell/ii/modules/sidebarLeft/anime/BooruImage.qml @@ -28,7 +28,7 @@ Button { Process { id: downloadProcess running: false - command: ["bash", "-c", `[ -f ${root.filePath} ] || curl -sSL '${root.imageData.preview_url ?? root.imageData.sample_url}' -o '${root.filePath}'`] + command: ["bash", "-c", `mkdir -p '${root.previewDownloadPath}' && [ -f ${root.filePath} ] || curl -sSL '${root.imageData.preview_url ?? root.imageData.sample_url}' -o '${root.filePath}'`] onExited: (exitCode, exitStatus) => { imageObject.source = `${previewDownloadPath}/${root.fileName}` } @@ -170,9 +170,10 @@ Button { Layout.fillWidth: true buttonText: Translation.tr("Download") onClicked: { - root.showActions = false + root.showActions = false; + const targetPath = root.imageData.is_nsfw ? root.nsfwPath : root.downloadPath; Quickshell.execDetached(["bash", "-c", - `curl '${root.imageData.file_url}' -o '${root.imageData.is_nsfw ? root.nsfwPath : root.downloadPath}/${root.fileName}' && notify-send '${Translation.tr("Download complete")}' '${root.downloadPath}/${root.fileName}' -a 'Shell'` + `mkdir -p '${targetPath}' && curl '${root.imageData.file_url}' -o '${targetPath}/${root.fileName}' && notify-send '${Translation.tr("Download complete")}' '${root.downloadPath}/${root.fileName}' -a 'Shell'` ]) } }