From 4529a26554a52c35393f8b0bc2928e4c11984807 Mon Sep 17 00:00:00 2001 From: rgaudin Date: Tue, 8 Oct 2024 15:53:22 +0000 Subject: [PATCH] fixed webdav json parsing (entry can be str or dict) --- backend/api/routes/projects.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/api/routes/projects.py b/backend/api/routes/projects.py index fc74507..b28398a 100644 --- a/backend/api/routes/projects.py +++ b/backend/api/routes/projects.py @@ -154,7 +154,11 @@ def __init__(self, data: list[dict[str, str | list[str]]]): self.data = data self.files_indexes: dict[str, int] = {} for index, entry in enumerate(self.data): - for filename in entry.get("files", []): + for fileentry in entry.get("files", []): + if isinstance(fileentry, str): + filename = fileentry + else: + filename = fileentry["filename"] self.files_indexes[filename] = index def __getitem__(self, key: str):