forked from Shinonome/dots-hyprland
don't create homework folder before it's necessary (#2264)
This commit is contained in:
@@ -23,15 +23,6 @@ Item {
|
|||||||
property var suggestionQuery: ""
|
property var suggestionQuery: ""
|
||||||
property var suggestionList: []
|
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 {
|
Connections {
|
||||||
target: Booru
|
target: Booru
|
||||||
function onTagSuggestion(query, suggestions) {
|
function onTagSuggestion(query, suggestions) {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ Button {
|
|||||||
Process {
|
Process {
|
||||||
id: downloadProcess
|
id: downloadProcess
|
||||||
running: false
|
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) => {
|
onExited: (exitCode, exitStatus) => {
|
||||||
imageObject.source = `${previewDownloadPath}/${root.fileName}`
|
imageObject.source = `${previewDownloadPath}/${root.fileName}`
|
||||||
}
|
}
|
||||||
@@ -170,9 +170,10 @@ Button {
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
buttonText: Translation.tr("Download")
|
buttonText: Translation.tr("Download")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
root.showActions = false
|
root.showActions = false;
|
||||||
|
const targetPath = root.imageData.is_nsfw ? root.nsfwPath : root.downloadPath;
|
||||||
Quickshell.execDetached(["bash", "-c",
|
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'`
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user