collection stats - whole collection (#169)

* Add endpoint to retrieve collection stats report

* Create separate test for statistics

* Add test for collectionStats

* Fixed typo

* Change endpoint name to use a verb

* Change name to getCollectionStatsHTML

* Allow stats for whole collection

* Allow stats for whole collection
This commit is contained in:
Scott Noyes 2020-05-07 20:49:48 -05:00 committed by GitHub
parent ad0e41d950
commit 2ca35712f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -377,7 +377,10 @@ guarantee that your application continues to function properly in the future.
```json
{
"action": "getCollectionStatsHTML",
"version": 6
"version": 6,
"params": {
"wholeCollection": true
}
}
```

View File

@ -299,8 +299,10 @@ class AnkiConnect:
@util.api()
def getCollectionStatsHTML(self):
return self.collection().stats().report()
def getCollectionStatsHTML(self, wholeCollection=True):
stats = self.collection().stats()
stats.wholeCollection = wholeCollection
return stats.report()
#