mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 09:14:35 +02:00
feat(settings): add base path support for output folders
Change "Images folder" and "Grids folder" settings to act as base paths that combine with specific folder settings, rather than replacing them. - Add resolve_output_path() helper function to modules/paths.py - Update all output path usages to use combined base + specific paths - Update gallery API to return resolved paths with display labels - Update gallery UI to show short labels with full path on hover Example: If base is "C:\Database\" and specific is "outputs/text", the resolved path becomes "C:\Database\outputs\text" Edge cases handled: - Empty base path: uses specific path directly (backward compatible) - Absolute specific path: ignores base path - Empty specific path: uses base path only
This commit is contained in:
+11
-4
@@ -239,9 +239,16 @@ class SimpleFunctionQueue {
|
||||
// HTML Elements
|
||||
|
||||
class GalleryFolder extends HTMLElement {
|
||||
constructor(name) {
|
||||
constructor(folder) {
|
||||
super();
|
||||
this.name = decodeURI(name);
|
||||
// Support both old format (string) and new format (object with path and label)
|
||||
if (typeof folder === 'object' && folder !== null) {
|
||||
this.name = decodeURI(folder.path || '');
|
||||
this.label = decodeURI(folder.label || folder.path || '');
|
||||
} else {
|
||||
this.name = decodeURI(folder);
|
||||
this.label = this.name;
|
||||
}
|
||||
this.style.overflowX = 'hidden';
|
||||
this.shadow = this.attachShadow({ mode: 'open' });
|
||||
this.shadow.adoptedStyleSheets = [folderStylesheet];
|
||||
@@ -250,8 +257,8 @@ class GalleryFolder extends HTMLElement {
|
||||
connectedCallback() {
|
||||
const div = document.createElement('div');
|
||||
div.className = 'gallery-folder';
|
||||
div.innerHTML = `<span class="gallery-folder-icon">\uf03e</span> ${this.name}`;
|
||||
div.title = this.name;
|
||||
div.innerHTML = `<span class="gallery-folder-icon">\uf03e</span> ${this.label}`;
|
||||
div.title = this.name; // Show full path on hover
|
||||
div.addEventListener('click', () => {
|
||||
for (const folder of el.folders.children) {
|
||||
if (folder.name === this.name) folder.shadow.firstElementChild.classList.add('gallery-folder-selected');
|
||||
|
||||
Reference in New Issue
Block a user