Initial task for building

This commit is contained in:
shamoon
2025-11-04 20:55:12 -08:00
parent 130782eb07
commit 4b32639472
7 changed files with 312 additions and 11 deletions

View File

@@ -2190,6 +2190,7 @@ class ShareBundleSerializer(OwnedObjectSerializer):
"status",
"size_bytes",
"last_error",
"built_at",
"documents",
"document_ids",
"document_count",
@@ -2202,6 +2203,7 @@ class ShareBundleSerializer(OwnedObjectSerializer):
"status",
"size_bytes",
"last_error",
"built_at",
"documents",
"document_count",
)
@@ -2253,10 +2255,14 @@ class ShareBundleSerializer(OwnedObjectSerializer):
ordered_documents = [documents_by_id[doc_id] for doc_id in document_ids]
share_bundle.documents.set(ordered_documents)
share_bundle.document_total = len(ordered_documents)
return share_bundle
def get_document_count(self, obj: ShareBundle) -> int:
count = getattr(obj, "document_total", None)
if count is not None:
return count
return obj.documents.count()