forked from Shinonome/dots-hyprland
booru: save preferences, nuke save in folder by tags
save in folder by tags is unnecessary because saved images have proper file names now
This commit is contained in:
@@ -35,8 +35,7 @@
|
|||||||
"Powered by yande.re and konachan": "Powered by yande.re and konachan",
|
"Powered by yande.re and konachan": "Powered by yande.re and konachan",
|
||||||
"An image booru. May contain NSFW content.\nWatch your back.\n\nDisclaimer: Not affiliated with the provider\nnor responsible for any of its content.": "An image booru. May contain NSFW content.\nWatch your back.\n\nDisclaimer: Not affiliated with the provider\nnor responsible for any of its content.",
|
"An image booru. May contain NSFW content.\nWatch your back.\n\nDisclaimer: Not affiliated with the provider\nnor responsible for any of its content.": "An image booru. May contain NSFW content.\nWatch your back.\n\nDisclaimer: Not affiliated with the provider\nnor responsible for any of its content.",
|
||||||
"Lewds": "Lewds",
|
"Lewds": "Lewds",
|
||||||
"Shows naughty stuff when enabled.\nYa like those? Add this to user_options.js:\n\t'sidebar': {\n\t'image': {\n\t\t'allowNsfw': true,\n\t}\n}": "Shows naughty stuff when enabled.\nYa like those? Add this to user_options.js:\n\t'sidebar': {\n\t'image': {\n\t\t'allowNsfw': true,\n\t}\n}",
|
"Shows naughty stuff when enabled": "Shows naughty stuff when enabled",
|
||||||
"Save in folder by tags": "Save in folder by tags",
|
|
||||||
"Saves images in folders by their tags": "Saves images in folders by their tags",
|
"Saves images in folders by their tags": "Saves images in folders by their tags",
|
||||||
"Message Gemini...": "Message Gemini...",
|
"Message Gemini...": "Message Gemini...",
|
||||||
"Enter Google AI API Key...": "Enter Google AI API Key...",
|
"Enter Google AI API Key...": "Enter Google AI API Key...",
|
||||||
|
|||||||
@@ -35,8 +35,7 @@
|
|||||||
"Powered by yande.re and konachan": "قدرت گرفته از yande.re و konachan",
|
"Powered by yande.re and konachan": "قدرت گرفته از yande.re و konachan",
|
||||||
"An image booru. May contain NSFW content.\nWatch your back.\n\nDisclaimer: Not affiliated with the provider\nnor responsible for any of its content.": "یک تصویر بورو. ممکن است محتوای NSFW داشته باشد.\nمواظب باشید.\n\nتوجه: بدون وابستگی به ارائهدهنده\nو مسئول هیچیک از محتوای آن نیست.",
|
"An image booru. May contain NSFW content.\nWatch your back.\n\nDisclaimer: Not affiliated with the provider\nnor responsible for any of its content.": "یک تصویر بورو. ممکن است محتوای NSFW داشته باشد.\nمواظب باشید.\n\nتوجه: بدون وابستگی به ارائهدهنده\nو مسئول هیچیک از محتوای آن نیست.",
|
||||||
"Lewds": "محتوای نامناسب",
|
"Lewds": "محتوای نامناسب",
|
||||||
"Shows naughty stuff when enabled.\nYa like those? Add this to user_options.js:\n\t'sidebar': {\n\t'image': {\n\t\t'allowNsfw': true,\n\t}\n}": "محتوای نامناسب را زمانی که فعال باشد نشان میدهد.\nآیا از اینها خوشتان میآید؟ این را به user_options.js اضافه کنید:\n\t'sidebar': {\n\t'image': {\n\t\t'allowNsfw': true,\n\t}\n}",
|
"Shows naughty stuff when enabled": "محتوای نامناسب را زمانی که فعال باشد نشان میدهد",
|
||||||
"Save in folder by tags": "نگهداری در پوشه بر اساس برچسبها",
|
|
||||||
"Saves images in folders by their tags": "تصاویر را در پوشهها بر اساس برچسبهایشان نگهداری میکند",
|
"Saves images in folders by their tags": "تصاویر را در پوشهها بر اساس برچسبهایشان نگهداری میکند",
|
||||||
"Message Gemini...": "پیام به Gemini...",
|
"Message Gemini...": "پیام به Gemini...",
|
||||||
"Enter Google AI API Key...": "کلید API گوگل AI را وارد کنید...",
|
"Enter Google AI API Key...": "کلید API گوگل AI را وارد کنید...",
|
||||||
|
|||||||
@@ -35,8 +35,7 @@
|
|||||||
"Powered by yande.re and konachan": "Propulsé par yande.re et konachan",
|
"Powered by yande.re and konachan": "Propulsé par yande.re et konachan",
|
||||||
"An image booru. May contain NSFW content.\nWatch your back.\n\nDisclaimer: Not affiliated with the provider\nnor responsible for any of its content.": "Un booru d'images. Peut contenir du contenu NSFW.\nFais attention.\n\nAvertissement : Pas affilié au fournisseur\net pas responsable de son contenu.",
|
"An image booru. May contain NSFW content.\nWatch your back.\n\nDisclaimer: Not affiliated with the provider\nnor responsible for any of its content.": "Un booru d'images. Peut contenir du contenu NSFW.\nFais attention.\n\nAvertissement : Pas affilié au fournisseur\net pas responsable de son contenu.",
|
||||||
"Lewds": "Contenu osé",
|
"Lewds": "Contenu osé",
|
||||||
"Shows naughty stuff when enabled.\nYa like those? Add this to user_options.js:\n\t'sidebar': {\n\t'image': {\n\t\t'allowNsfw': true,\n\t}\n}": "Affiche du contenu osé lorsqu'il est activé.\nTu aimes ça ? Ajoute ceci dans user_options.js :\n\t'sidebar': {\n\t'image': {\n\t\t'allowNsfw': true\n\t}\n}",
|
"Shows naughty stuff when enabled": "Affiche du contenu osé lorsqu'il est activé",
|
||||||
"Save in folder by tags": "Enregistrer dans un dossier par tags",
|
|
||||||
"Saves images in folders by their tags": "Enregistre les images dans des dossiers selon leurs tags",
|
"Saves images in folders by their tags": "Enregistre les images dans des dossiers selon leurs tags",
|
||||||
"Message Gemini...": "Envoyer un message à Gemini...",
|
"Message Gemini...": "Envoyer un message à Gemini...",
|
||||||
"Enter Google AI API Key...": "Saisissez la clé API de Google AI...",
|
"Enter Google AI API Key...": "Saisissez la clé API de Google AI...",
|
||||||
|
|||||||
@@ -35,8 +35,7 @@
|
|||||||
"Powered by yande.re and konachan": "Offerto da yande.re e konachan",
|
"Powered by yande.re and konachan": "Offerto da yande.re e konachan",
|
||||||
"An image booru. May contain NSFW content.\nWatch your back.\n\nDisclaimer: Not affiliated with the provider\nnor responsible for any of its content.": "Un booru di immagini. Potrebbe contenere contenuti NSFW.\nFai attenzione.\n\nDisclaimer: Non affiliato al provider\nné responsabile per alcun suo contenuto.",
|
"An image booru. May contain NSFW content.\nWatch your back.\n\nDisclaimer: Not affiliated with the provider\nnor responsible for any of its content.": "Un booru di immagini. Potrebbe contenere contenuti NSFW.\nFai attenzione.\n\nDisclaimer: Non affiliato al provider\nné responsabile per alcun suo contenuto.",
|
||||||
"Lewds": "Contenuti osé",
|
"Lewds": "Contenuti osé",
|
||||||
"Shows naughty stuff when enabled.\nYa like those? Add this to user_options.js:\n\t'sidebar': {\n\t'image': {\n\t\t'allowNsfw': true,\n\t}\n}": "Mostra contenuti osé quando abilitato.\nTi piacciono? Aggiungi questo a user_options.js:\n\t'sidebar': {\n\t'image': {\n\t\t'allowNsfw': true,\n\t}\n}",
|
"Shows naughty stuff when enabled": "Mostra contenuti osé quando abilitato",
|
||||||
"Save in folder by tags": "Salva in cartella per tag",
|
|
||||||
"Saves images in folders by their tags": "Salva le immagini in cartelle in base ai loro tag",
|
"Saves images in folders by their tags": "Salva le immagini in cartelle in base ai loro tag",
|
||||||
"Message Gemini...": "Messaggia Gemini...",
|
"Message Gemini...": "Messaggia Gemini...",
|
||||||
"Enter Google AI API Key...": "Inserisci la chiave API di Google AI...",
|
"Enter Google AI API Key...": "Inserisci la chiave API di Google AI...",
|
||||||
|
|||||||
@@ -35,8 +35,7 @@
|
|||||||
"Powered by yande.re and konachan": "由 yande.re 和 konachan 提供支持",
|
"Powered by yande.re and konachan": "由 yande.re 和 konachan 提供支持",
|
||||||
"An image booru. May contain NSFW content.\nWatch your back.\n\nDisclaimer: Not affiliated with the provider\nnor responsible for any of its content.": "一个图片图库。可能包含 NSFW 内容。\n小心。\n\n免责声明:与提供商无关联\n也不对它的任何内容负责。",
|
"An image booru. May contain NSFW content.\nWatch your back.\n\nDisclaimer: Not affiliated with the provider\nnor responsible for any of its content.": "一个图片图库。可能包含 NSFW 内容。\n小心。\n\n免责声明:与提供商无关联\n也不对它的任何内容负责。",
|
||||||
"Lewds": "不雅内容",
|
"Lewds": "不雅内容",
|
||||||
"Shows naughty stuff when enabled.\nYa like those? Add this to user_options.js:\n\t'sidebar': {\n\t'image': {\n\t\t'allowNsfw': true,\n\t}\n}": "启用时显示不雅内容。\n你喜欢这些?添加到 user_options.js 中:\n'sidebar': {\n\t'image': {\n\t\t'allowNsfw': true,\n\t}\n}",
|
"Shows naughty stuff when enabled": "启用时显示不雅内容",
|
||||||
"Save in folder by tags": "按标签保存到文件夹",
|
|
||||||
"Saves images in folders by their tags": "按标签将图片保存到文件夹中",
|
"Saves images in folders by their tags": "按标签将图片保存到文件夹中",
|
||||||
"Message Gemini...": "向 Gemini 发送消息...",
|
"Message Gemini...": "向 Gemini 发送消息...",
|
||||||
"Enter Google AI API Key...": "输入 Google AI API 密钥...",
|
"Enter Google AI API Key...": "输入 Google AI API 密钥...",
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ export const AgsToggle = ({
|
|||||||
icon, name, desc = null,
|
icon, name, desc = null,
|
||||||
option, resetButton = true, save = true,
|
option, resetButton = true, save = true,
|
||||||
extraOnChange = () => { }, extraOnReset = () => { },
|
extraOnChange = () => { }, extraOnReset = () => { },
|
||||||
|
...rest
|
||||||
}) => ConfigToggle({
|
}) => ConfigToggle({
|
||||||
icon: icon,
|
icon: icon,
|
||||||
name: name,
|
name: name,
|
||||||
@@ -35,6 +36,7 @@ export const AgsToggle = ({
|
|||||||
--file ${AGS_CONFIG_FILE}'`);
|
--file ${AGS_CONFIG_FILE}'`);
|
||||||
extraOnReset(self);
|
extraOnReset(self);
|
||||||
},
|
},
|
||||||
|
...rest
|
||||||
});
|
});
|
||||||
|
|
||||||
export const AgsSpinButton = ({
|
export const AgsSpinButton = ({
|
||||||
|
|||||||
@@ -103,8 +103,7 @@
|
|||||||
"image": {
|
"image": {
|
||||||
"columns": 2,
|
"columns": 2,
|
||||||
"batchCount": 20,
|
"batchCount": 20,
|
||||||
"allowNsfw": false,
|
"allowNsfw": false
|
||||||
"saveInFolderByTags": false
|
|
||||||
},
|
},
|
||||||
"pages": {
|
"pages": {
|
||||||
"order": ["apis", "tools"],
|
"order": ["apis", "tools"],
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import { MaterialIcon } from '../../.commonwidgets/materialicon.js';
|
|||||||
import { MarginRevealer } from '../../.widgethacks/advancedrevealers.js';
|
import { MarginRevealer } from '../../.widgethacks/advancedrevealers.js';
|
||||||
import { setupCursorHover, setupCursorHoverInfo } from '../../.widgetutils/cursorhover.js';
|
import { setupCursorHover, setupCursorHoverInfo } from '../../.widgetutils/cursorhover.js';
|
||||||
import BooruService from '../../../services/booru.js';
|
import BooruService from '../../../services/booru.js';
|
||||||
import { ConfigToggle } from '../../.commonwidgets/configwidgets.js';
|
|
||||||
import { SystemMessage } from './ai_chatmessage.js';
|
import { SystemMessage } from './ai_chatmessage.js';
|
||||||
|
import { AgsToggle } from '../../.commonwidgets/configwidgets_apps.js';
|
||||||
|
|
||||||
const IMAGE_REVEAL_DELAY = 13; // Some wait for inits n other weird stuff
|
const IMAGE_REVEAL_DELAY = 13; // Some wait for inits n other weird stuff
|
||||||
const USER_CACHE_DIR = GLib.get_user_cache_dir();
|
const USER_CACHE_DIR = GLib.get_user_cache_dir();
|
||||||
@@ -93,27 +93,18 @@ export const BooruSettings = () => MarginRevealer({
|
|||||||
hpack: 'center',
|
hpack: 'center',
|
||||||
className: 'sidebar-chat-settings-toggles',
|
className: 'sidebar-chat-settings-toggles',
|
||||||
children: [
|
children: [
|
||||||
ConfigToggle({
|
AgsToggle({
|
||||||
icon: 'menstrual_health',
|
icon: 'menstrual_health',
|
||||||
name: getString('Lewds'),
|
name: getString('Lewds'),
|
||||||
desc: getString("Shows naughty stuff when enabled.\nYa like those? Add this to user_options.js:\n\t'sidebar': {\n\t'image': {\n\t\t'allowNsfw': true,\n\t}\n}"),
|
desc: getString("Shows naughty stuff when enabled"),
|
||||||
initValue: BooruService.nsfw,
|
option: 'sidebar.image.allowNsfw',
|
||||||
onChange: (self, newValue) => {
|
extraOnChange: (self, newValue) => {
|
||||||
BooruService.nsfw = newValue;
|
BooruService.nsfw = newValue;
|
||||||
},
|
},
|
||||||
extraSetup: (self) => self.hook(BooruService, (self) => {
|
extraSetup: (self) => self.hook(BooruService, (self) => {
|
||||||
self.attribute.enabled.value = BooruService.nsfw;
|
self.attribute.enabled.value = BooruService.nsfw;
|
||||||
}, 'notify::nsfw')
|
}, 'notify::nsfw')
|
||||||
}),
|
}),
|
||||||
ConfigToggle({
|
|
||||||
icon: 'sell',
|
|
||||||
name: getString('Save in folder by tags'),
|
|
||||||
desc: getString('Saves images in folders by their tags'),
|
|
||||||
initValue: userOptions.sidebar.image.saveInFolderByTags,
|
|
||||||
onChange: (self, newValue) => {
|
|
||||||
userOptions.sidebar.image.saveInFolderByTags = newValue;
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
@@ -228,7 +219,7 @@ const BooruPage = (taglist, serviceName = 'Booru') => {
|
|||||||
const currentTags = BooruService.queries.at(-1).realTagList.filter(tag => !tag.includes('rating:'));
|
const currentTags = BooruService.queries.at(-1).realTagList.filter(tag => !tag.includes('rating:'));
|
||||||
const tagDirectory = currentTags.join('+');
|
const tagDirectory = currentTags.join('+');
|
||||||
const fileName = decodeURIComponent((data.file_url).substring((data.file_url).lastIndexOf('/') + 1));
|
const fileName = decodeURIComponent((data.file_url).substring((data.file_url).lastIndexOf('/') + 1));
|
||||||
const saveCommand = `mkdir -p "$(xdg-user-dir PICTURES)/homework/${data.is_nsfw ? '🌶️/' : ''}${userOptions.sidebar.image.saveInFolderByTags ? tagDirectory : ''}" && curl -L -o "$(xdg-user-dir PICTURES)/homework/${data.is_nsfw ? '🌶️/' : ''}${userOptions.sidebar.image.saveInFolderByTags ? (tagDirectory + '/') : ''}${fileName}" '${data.file_url}'`;
|
const saveCommand = `mkdir -p "$(xdg-user-dir PICTURES)/homework/${data.is_nsfw ? '🌶️/' : ''}" && curl -L -o "$(xdg-user-dir PICTURES)/homework/${data.is_nsfw ? '🌶️/' : ''}${fileName}" '${data.file_url}'`;
|
||||||
print(saveCommand)
|
print(saveCommand)
|
||||||
execAsync(['bash', '-c', saveCommand])
|
execAsync(['bash', '-c', saveCommand])
|
||||||
.then(() => self.label = 'done')
|
.then(() => self.label = 'done')
|
||||||
|
|||||||
Reference in New Issue
Block a user