Skip to content

Commit

Permalink
fix: finding default libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
xgui3783 committed Feb 16, 2024
1 parent e157d71 commit 7c3af2f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion backend/voluba_backend/voluba_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@ def custom_src(request: Request):

# n.b. do not "get_repo_by_name"
# based on localization, the default repo name may be "My Library" or "Meine Bibliothek" etc
lib: Repo = client.repos.get_default_repo()

my_libraries = client.repos.get_repos_by_name("my-siibra-library")
if len(my_libraries) == 0:
my_libraries = client.repos.get_repos_by_name("My Library")
assert len(my_libraries) == 1

lib: Repo = my_libraries[0]
file = lib.get_file("/voluba/customSrc.json")
custom_src = json.loads(file.get_content())
return JSONResponse(custom_src)

0 comments on commit 7c3af2f

Please sign in to comment.