Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Dec 11, 2024
1 parent a71aaa8 commit b05d58a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions moabb/datasets/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,24 +220,24 @@ def fs_get_file_list(article_id, version=None):
fsurl = "https://api.figshare.com/v2"
all_files = []
page = 1

while True:
if version is None:
url = f"{fsurl}/articles/{article_id}/files?page={page}&page_size=100"
headers = {"Content-Type": "application/json"}
response = fs_issue_request("GET", url, headers=headers)

if not response: # If response is empty, we've got all files
break

all_files.extend(response)
page += 1
else:
url = f"{fsurl}/articles/{article_id}/versions/{version}"
headers = {"Content-Type": "application/json"}
request = fs_issue_request("GET", url, headers=headers)
return request["files"]

return all_files


Expand Down

0 comments on commit b05d58a

Please sign in to comment.