diff --git a/py/recipes/base.py b/py/recipes/base.py index f47ba3f0..78bb933f 100644 --- a/py/recipes/base.py +++ b/py/recipes/base.py @@ -119,10 +119,10 @@ class RecipeMetadataParser(ABC): # Check if exists locally if recipe_scanner and lora_entry['hash']: lora_scanner = recipe_scanner._lora_scanner - exists_locally = lora_scanner.has_lora_hash(lora_entry['hash']) + exists_locally = lora_scanner.has_hash(lora_entry['hash']) if exists_locally: try: - local_path = lora_scanner.get_lora_path_by_hash(lora_entry['hash']) + local_path = lora_scanner.get_path_by_hash(lora_entry['hash']) lora_entry['existsLocally'] = True lora_entry['localPath'] = local_path lora_entry['file_name'] = os.path.splitext(os.path.basename(local_path))[0] diff --git a/py/recipes/parsers/recipe_format.py b/py/recipes/parsers/recipe_format.py index 37b71712..667bdc43 100644 --- a/py/recipes/parsers/recipe_format.py +++ b/py/recipes/parsers/recipe_format.py @@ -55,7 +55,7 @@ class RecipeFormatParser(RecipeMetadataParser): # Check if this LoRA exists locally by SHA256 hash if lora.get('hash') and recipe_scanner: lora_scanner = recipe_scanner._lora_scanner - exists_locally = lora_scanner.has_lora_hash(lora['hash']) + exists_locally = lora_scanner.has_hash(lora['hash']) if exists_locally: lora_cache = await lora_scanner.get_cached_data() lora_item = next((item for item in lora_cache.raw_data if item['sha256'].lower() == lora['hash'].lower()), None) diff --git a/py/routes/base_model_routes.py b/py/routes/base_model_routes.py index 33f47193..96585c1e 100644 --- a/py/routes/base_model_routes.py +++ b/py/routes/base_model_routes.py @@ -408,7 +408,7 @@ class BaseModelRoutes(ABC): group["models"].append(await self.service.format_response(model)) # Find the model from the main index too - hash_val = self.service.scanner._hash_index.get_hash_by_filename(filename) + hash_val = self.service.scanner.get_hash_by_filename(filename) if hash_val: main_path = self.service.get_path_by_hash(hash_val) if main_path and main_path not in paths: diff --git a/static/js/managers/ImportManager.js b/static/js/managers/ImportManager.js index 5a5f1fb7..926720c9 100644 --- a/static/js/managers/ImportManager.js +++ b/static/js/managers/ImportManager.js @@ -1,7 +1,5 @@ import { modalManager } from './ModalManager.js'; -import { showToast } from '../utils/uiHelpers.js'; import { LoadingManager } from './LoadingManager.js'; -import { getStorageItem } from '../utils/storageHelpers.js'; import { ImportStepManager } from './import/ImportStepManager.js'; import { ImageProcessor } from './import/ImageProcessor.js'; import { RecipeDataManager } from './import/RecipeDataManager.js'; @@ -86,8 +84,8 @@ export class ImportManager { const uploadError = document.getElementById('uploadError'); if (uploadError) uploadError.textContent = ''; - const urlError = document.getElementById('urlError'); - if (urlError) urlError.textContent = ''; + const importUrlError = document.getElementById('importUrlError'); + if (importUrlError) importUrlError.textContent = ''; const recipeName = document.getElementById('recipeName'); if (recipeName) recipeName.value = ''; @@ -167,10 +165,10 @@ export class ImportManager { // Clear error messages const uploadError = document.getElementById('uploadError'); - const urlError = document.getElementById('urlError'); + const importUrlError = document.getElementById('importUrlError'); if (uploadError) uploadError.textContent = ''; - if (urlError) urlError.textContent = ''; + if (importUrlError) importUrlError.textContent = ''; } handleImageUpload(event) { @@ -224,8 +222,8 @@ export class ImportManager { const uploadError = document.getElementById('uploadError'); if (uploadError) uploadError.textContent = ''; - const urlError = document.getElementById('urlError'); - if (urlError) urlError.textContent = ''; + const importUrlError = document.getElementById('importUrlError'); + if (importUrlError) importUrlError.textContent = ''; } backToDetails() { diff --git a/static/js/managers/import/ImageProcessor.js b/static/js/managers/import/ImageProcessor.js index d428b720..264c2d3d 100644 --- a/static/js/managers/import/ImageProcessor.js +++ b/static/js/managers/import/ImageProcessor.js @@ -27,7 +27,7 @@ export class ImageProcessor { async handleUrlInput() { const urlInput = document.getElementById('imageUrlInput'); - const errorElement = document.getElementById('urlError'); + const errorElement = document.getElementById('importUrlError'); const input = urlInput.value.trim(); // Validate input diff --git a/templates/components/import_modal.html b/templates/components/import_modal.html index aafe00f6..243b5cc5 100644 --- a/templates/components/import_modal.html +++ b/templates/components/import_modal.html @@ -25,7 +25,7 @@ Fetch Image -
+