mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-11-01 21:07:01 +08:00
fix(types): guard nullable AliPan streams
This commit is contained in:
@@ -14,9 +14,9 @@ from app.runtime.log import logger
|
||||
from app.runtime.settings import get_runtime_setting
|
||||
from app.runtime.stop import runtime_stop_state
|
||||
from app.schemas.exception import StorageQueryError
|
||||
from app.schemas.file import FileItem as _SchemaFileItem
|
||||
from app.schemas.file import StorageUsage as _SchemaStorageUsage
|
||||
from app.schemas.types import StorageSchema
|
||||
from app.schemas.workflow import FileItem as _SchemaFileItem
|
||||
|
||||
lock = threading.Lock()
|
||||
|
||||
@@ -791,6 +791,8 @@ class AliPan(StorageBase, metaclass=WeakSingleton):
|
||||
|
||||
request_utils = RequestUtils(headers=headers)
|
||||
with request_utils.get_stream(download_url, raise_exception=True) as r:
|
||||
if r is None:
|
||||
return None
|
||||
r.raise_for_status()
|
||||
downloaded_size = 0
|
||||
with open(local_path, "wb") as f:
|
||||
|
||||
Reference in New Issue
Block a user