Skip to content

Commit 7ab7d82

Browse files
committed
count cards, not all docs, for cardCount
1 parent 7ca8ae2 commit 7ab7d82

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/db/src/impl/static/courseDB.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,14 @@ export class StaticCourseDB implements CourseDBInterface {
4242
}
4343

4444
async getCourseInfo(): Promise<CourseInfo> {
45+
// Count only cards, not all documents
46+
// Use chunks metadata to count card documents specifically
47+
const cardCount = this.manifest.chunks
48+
.filter(chunk => chunk.docType === DocType.CARD)
49+
.reduce((total, chunk) => total + chunk.documentCount, 0);
50+
4551
return {
46-
cardCount: this.manifest.documentCount || 0,
52+
cardCount,
4753
registeredUsers: 0, // Always 0 in static mode
4854
};
4955
}

0 commit comments

Comments
 (0)