mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-21 21:22:11 -03:00
feat(recipes): persist 'Skip images without metadata' choice in batch import
This commit is contained in:
@@ -2,6 +2,7 @@ import { modalManager } from './ModalManager.js';
|
|||||||
import { showToast } from '../utils/uiHelpers.js';
|
import { showToast } from '../utils/uiHelpers.js';
|
||||||
import { translate } from '../utils/i18nHelpers.js';
|
import { translate } from '../utils/i18nHelpers.js';
|
||||||
import { WS_ENDPOINTS } from '../api/apiConfig.js';
|
import { WS_ENDPOINTS } from '../api/apiConfig.js';
|
||||||
|
import { getStorageItem, setStorageItem } from '../utils/storageHelpers.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manager for batch importing recipes from multiple images
|
* Manager for batch importing recipes from multiple images
|
||||||
@@ -34,6 +35,14 @@ export class BatchImportManager {
|
|||||||
*/
|
*/
|
||||||
initialize() {
|
initialize() {
|
||||||
this.initialized = true;
|
this.initialized = true;
|
||||||
|
|
||||||
|
// Add event listener for persisting "Skip images without metadata" choice
|
||||||
|
const skipNoMetadata = document.getElementById('batchSkipNoMetadata');
|
||||||
|
if (skipNoMetadata) {
|
||||||
|
skipNoMetadata.addEventListener('change', (e) => {
|
||||||
|
setStorageItem('batch_import_skip_no_metadata', e.target.checked);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -61,7 +70,10 @@ export class BatchImportManager {
|
|||||||
if (tagsInput) tagsInput.value = '';
|
if (tagsInput) tagsInput.value = '';
|
||||||
|
|
||||||
const skipNoMetadata = document.getElementById('batchSkipNoMetadata');
|
const skipNoMetadata = document.getElementById('batchSkipNoMetadata');
|
||||||
if (skipNoMetadata) skipNoMetadata.checked = true;
|
if (skipNoMetadata) {
|
||||||
|
// Load preference from storage, defaulting to true
|
||||||
|
skipNoMetadata.checked = getStorageItem('batch_import_skip_no_metadata', true);
|
||||||
|
}
|
||||||
|
|
||||||
const recursiveCheck = document.getElementById('batchRecursiveCheck');
|
const recursiveCheck = document.getElementById('batchRecursiveCheck');
|
||||||
if (recursiveCheck) recursiveCheck.checked = true;
|
if (recursiveCheck) recursiveCheck.checked = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user