Collection management part 2 (#522)

* Plumb collection manager into librarian

* Test end-to-end
This commit is contained in:
cybermaggedon 2025-09-19 16:08:47 +01:00 committed by GitHub
parent d378db9370
commit fcd15d1833
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 617 additions and 434 deletions

View file

@ -27,6 +27,14 @@ class Collection:
object = self.request(input)
try:
# Handle case where collections might be None or missing
if object is None or "collections" not in object:
return []
collections = object.get("collections", [])
if collections is None:
return []
return [
CollectionMetadata(
user = v["user"],
@ -37,7 +45,7 @@ class Collection:
created_at = v["created_at"],
updated_at = v["updated_at"]
)
for v in object["collections"]
for v in collections
]
except Exception as e:
logger.error("Failed to parse collection list response", exc_info=True)