|
@@ -38,17 +38,19 @@ class ListProjectFiles(View):
|
|
|
files = collection.get_files(offset=start, limit=length).all()
|
|
|
|
|
|
else:
|
|
|
- count = project.files.count()
|
|
|
-
|
|
|
|
|
|
with_annotations = request.args.get("only_with_annotations")
|
|
|
-
|
|
|
kwargs = dict(with_annotations=None)
|
|
|
|
|
|
if with_annotations is not None:
|
|
|
kwargs["with_annotations"] = with_annotations == "1"
|
|
|
|
|
|
- files = project.get_files(offset=start, limit=length, **kwargs).all()
|
|
|
+ # first get all files without specific limit
|
|
|
+ files = project.get_files(**kwargs)
|
|
|
+ # get the count of those
|
|
|
+ count = files.count()
|
|
|
+ # finally, limit to the desired offset and number of files
|
|
|
+ files = files.offset(start).limit(length).all()
|
|
|
|
|
|
# return files
|
|
|
return jsonify({
|