From 2edc9f06090823bee7bcfe7ab1c0130938476d6c Mon Sep 17 00:00:00 2001 From: jxxghp Date: Sat, 17 Oct 2026 09:31:55 +0800 Subject: [PATCH] mypy: guard transfer source paths --- app/chain/transfer/filter.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/chain/transfer/filter.py b/app/chain/transfer/filter.py index a7a913f1c..6576f059f 100644 --- a/app/chain/transfer/filter.py +++ b/app/chain/transfer/filter.py @@ -47,7 +47,7 @@ from app.schemas.types import ( MUSIC_ENTITY_RECORDING, MediaType, ) -from app.schemas.workflow import FileItem +from app.schemas.file import FileItem class NetworkFilesystemPort(Protocol): @@ -697,11 +697,14 @@ class FileFilterMixin(_TransferOwnerBase): return True if task.fileitem.storage != "local": return True + file_path = task.fileitem.path + if not file_path: + return True source_directory = ( Path(task.target_directory.download_path) if task.target_directory and task.target_directory.download_path - else Path(task.fileitem.path).parent + else Path(file_path).parent ) if source_directory not in mounted_filesystem_cache: mounted_filesystem_cache[source_directory] = (