fix(download): retrieve full folder to resolve type error

Retrieve the full Folder object from FoldersApi instead of using the
FolderSimple returned by find_sub_folder when resolving DOI subfolders.
This fixes a type checker error under the upgraded pyright, and avoids
a potential AttributeError at runtime due to FolderSimple lacking the
path attribute.

Also upgrade dependencies and bump version to 1.3.16 in pyproject.toml.
This commit is contained in:
2026-06-12 10:25:03 +09:00
parent 5bdf837941
commit 809140dfbc
2 changed files with 12 additions and 11 deletions
+3 -2
View File
@@ -98,9 +98,10 @@ class DownloadCommand(BaseCommand):
cls.__multiple_download(connection, context)
return
else:
folder = r_parent_folder.find_sub_folder(r_basename)
if folder is None:
folder_simple = r_parent_folder.find_sub_folder(r_basename)
if folder_simple is None:
raise IllegalArgumentException(f"File or folder `{subpath_clean}` not found.")
folder = FoldersApi(connection).retrieve(folder_simple.id)
is_folder = True
# For a DOI target the whole folder is the download target.