r3gm John6666 commited on
Commit
a764be9
1 Parent(s): 0ca70bf

Update utils.py (#11)

Browse files

- Update utils.py (1ee8bb8d2a9b77c6b601de0a009cb51a07e7daeb)


Co-authored-by: John Smith <[email protected]>

Files changed (1) hide show
  1. utils.py +1 -1
utils.py CHANGED
@@ -62,7 +62,7 @@ class ModelInformation:
62
  self.download_url = json_data.get("downloadUrl", "")
63
  self.model_url = f"https://civitai.com/models/{self.model_id}?modelVersionId={self.model_version_id}"
64
  self.filename_url = next(
65
- (v.get("name", "") for v in json_data.get("files", []) if str(self.model_version_id) in v.get("downloadUrl", "")), ""
66
  )
67
  self.filename_url = self.filename_url if self.filename_url else ""
68
  self.description = json_data.get("description", "")
 
62
  self.download_url = json_data.get("downloadUrl", "")
63
  self.model_url = f"https://civitai.com/models/{self.model_id}?modelVersionId={self.model_version_id}"
64
  self.filename_url = next(
65
+ (v.get("name", "") for v in reversed(json_data.get("files", [])) if str(self.model_version_id) in v.get("downloadUrl", "")), ""
66
  )
67
  self.filename_url = self.filename_url if self.filename_url else ""
68
  self.description = json_data.get("description", "")