diff --git a/ui/media/js/searchable-models.js b/ui/media/js/searchable-models.js index 737c7ee5..86c5c068 100644 --- a/ui/media/js/searchable-models.js +++ b/ui/media/js/searchable-models.js @@ -494,10 +494,6 @@ class ModelDropdown // Return its width and height return { width, height } } - - getFolder(model) { - return model.substring(0, model.lastIndexOf('/') + 1) - } /** * @param {Array} models @@ -607,7 +603,8 @@ class ModelDropdown if (isRootFolder) { classes.push('in-root-folder') } - const fullPath = `${folderName || ''}/${model}` + // Remove the leading slash from the model path + const fullPath = folderName ? `${folderName.substring(1)}/${model}` : model modelsMap.set( model, this.createElement('li', { 'data-path': fullPath }, classes, model),