mirror of
https://github.com/danbulant/dots-hyprland
synced 2026-05-24 12:22:09 +00:00
Update booru.js
This commit is contained in:
parent
54ea70bf4d
commit
b5f98347a7
1 changed files with 3 additions and 6 deletions
|
|
@ -221,17 +221,14 @@ const BooruPage = (taglist, serviceName = 'Booru') => {
|
|||
ImageAction({
|
||||
name: 'Save image',
|
||||
icon: 'save',
|
||||
action: () => {
|
||||
action: (self) => {
|
||||
const currentTags = BooruService.queries.at(-1).realTagList.filter(tag => !tag.includes('rating:'));
|
||||
const tagDirectory = currentTags.join('_');
|
||||
let fileExtension = data.file_ext || 'jpg';
|
||||
const saveCommand = `mkdir -p $(xdg-user-dir PICTURES)/homework/${tagDirectory} && curl -L -o $(xdg-user-dir PICTURES)/homework/${tagDirectory}/${data.md5}.${fileExtension} '${data.file_url}'`;
|
||||
execAsync(['bash', '-c', saveCommand])
|
||||
// .then(() => {
|
||||
// print(`Image saved to $(xdg-user-dir PICTURES)/homework/${tagDirectory}/${data.md5}.${data.file_ext}`);
|
||||
// })
|
||||
.then(() => self.label = 'done')
|
||||
.catch(print);
|
||||
.then(() => self.label = 'done')
|
||||
.catch(print);
|
||||
},
|
||||
}),
|
||||
]
|
||||
|
|
|
|||
Loading…
Reference in a new issue