Merge pull request #1588 from JeLuF/loraman1

Loramanager fixes
This commit is contained in:
cmdr2 2023-09-15 19:02:17 +05:30 committed by GitHub
commit 9fb0ee2d1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -55,8 +55,13 @@ def init():
return bucketfiles
else:
bucket_id = crud.get_bucket_by_path(db, path).id
bucket = crud.get_bucket_by_path(db, path)
if bucket == None:
raise HTTPException(status_code=404, detail="Bucket not found")
bucket_id = bucket.id
bucketfile = db.query(models.BucketFile).filter(models.BucketFile.bucket_id == bucket_id, models.BucketFile.filename == filename).first()
if bucketfile == None:
raise HTTPException(status_code=404, detail="File not found")
suffix = get_suffix_from_filename(filename)

View File

@ -645,8 +645,10 @@
} else {
LoraUI.keywordsField.value = info.keywords.join("\n")
LoraUI.notesField.value = info.notes
if ("civitai" in info) {
if ("civitai" in info && info["civitai"] != null) {
LoraUI.showCivitaiLink(info.civitai)
} else {
LoraUI.hideCivitaiLink()
}
}
})
@ -657,7 +659,6 @@
LoraUI.imagePlaceholder.classList.add("displayNone")
})
.catch((error) => {
console.error("Caught error:", error)
LoraUI.image.classList.add("displayNone")
LoraUI.imagePlaceholder.classList.remove("displayNone")
})