feat: update download path template handling for model types and migrate old settings

This commit is contained in:
Will Miao
2025-08-13 19:23:37 +08:00
parent e4195f874d
commit b8aa7184bd
5 changed files with 53 additions and 12 deletions

View File

@@ -92,7 +92,7 @@ export class SettingsManager {
// Ensure all model types have templates
Object.keys(DEFAULT_PATH_TEMPLATES).forEach(modelType => {
if (!state.global.settings.download_path_templates[modelType]) {
if (typeof state.global.settings.download_path_templates[modelType] === 'undefined') {
state.global.settings.download_path_templates[modelType] = DEFAULT_PATH_TEMPLATES[modelType];
}
});
@@ -586,7 +586,7 @@ export class SettingsManager {
// Find matching preset
const matchingPreset = this.findMatchingPreset(template);
if (matchingPreset) {
if (matchingPreset !== null) {
presetSelect.value = matchingPreset;
if (customRow) customRow.style.display = 'none';
} else {