mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 07:27:15 +08:00
fix alipan
This commit is contained in:
@@ -255,28 +255,9 @@ class AliPan(StorageBase, metaclass=Singleton):
|
|||||||
return []
|
return []
|
||||||
# 根目录处理
|
# 根目录处理
|
||||||
if not fileitem or not fileitem.drive_id:
|
if not fileitem or not fileitem.drive_id:
|
||||||
return [
|
items = self.aligo.get_file_list()
|
||||||
schemas.FileItem(
|
if items:
|
||||||
storage=self.schema.value,
|
return [self.__get_fileitem(item) for item in items]
|
||||||
fileid="root",
|
|
||||||
drive_id=self.__auth_params.get("resourceDriveId"),
|
|
||||||
parent_fileid="root",
|
|
||||||
type="dir",
|
|
||||||
path="/",
|
|
||||||
name="资源库",
|
|
||||||
basename="资源库"
|
|
||||||
),
|
|
||||||
schemas.FileItem(
|
|
||||||
storage=self.schema.value,
|
|
||||||
fileid="root",
|
|
||||||
drive_id=self.__auth_params.get("backDriveId"),
|
|
||||||
parent_fileid="root",
|
|
||||||
type="dir",
|
|
||||||
path="/",
|
|
||||||
name="备份盘",
|
|
||||||
basename="备份盘"
|
|
||||||
)
|
|
||||||
]
|
|
||||||
elif fileitem.type == "file":
|
elif fileitem.type == "file":
|
||||||
# 文件处理
|
# 文件处理
|
||||||
file = self.detail(fileitem)
|
file = self.detail(fileitem)
|
||||||
@@ -396,8 +377,8 @@ class AliPan(StorageBase, metaclass=Singleton):
|
|||||||
"""
|
"""
|
||||||
上传文件,并标记完成
|
上传文件,并标记完成
|
||||||
:param fileitem: 上传目录项
|
:param fileitem: 上传目录项
|
||||||
:param path: 目标目录
|
:param path: 本地文件路径
|
||||||
:param new_name: 新文件名
|
:param new_name: 上传后文件名
|
||||||
"""
|
"""
|
||||||
if not self.aligo:
|
if not self.aligo:
|
||||||
return None
|
return None
|
||||||
|
|||||||
@@ -194,6 +194,9 @@ class LocalStorage(StorageBase):
|
|||||||
def upload(self, fileitem: schemas.FileItem, path: Path, new_name: str = None) -> Optional[schemas.FileItem]:
|
def upload(self, fileitem: schemas.FileItem, path: Path, new_name: str = None) -> Optional[schemas.FileItem]:
|
||||||
"""
|
"""
|
||||||
上传文件
|
上传文件
|
||||||
|
:param fileitem: 上传目录项
|
||||||
|
:param path: 本地文件路径
|
||||||
|
:param new_name: 上传后文件名
|
||||||
"""
|
"""
|
||||||
dir_path = Path(fileitem.path)
|
dir_path = Path(fileitem.path)
|
||||||
target_path = dir_path / (new_name or path.name)
|
target_path = dir_path / (new_name or path.name)
|
||||||
|
|||||||
@@ -272,6 +272,9 @@ class Rclone(StorageBase):
|
|||||||
def upload(self, fileitem: schemas.FileItem, path: Path, new_name: str = None) -> Optional[schemas.FileItem]:
|
def upload(self, fileitem: schemas.FileItem, path: Path, new_name: str = None) -> Optional[schemas.FileItem]:
|
||||||
"""
|
"""
|
||||||
上传文件
|
上传文件
|
||||||
|
:param fileitem: 上传目录项
|
||||||
|
:param path: 本地文件路径
|
||||||
|
:param new_name: 上传后文件名
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
new_path = Path(fileitem.path) / (new_name or path.name)
|
new_path = Path(fileitem.path) / (new_name or path.name)
|
||||||
|
|||||||
@@ -339,6 +339,9 @@ class U115Pan(StorageBase, metaclass=Singleton):
|
|||||||
def upload(self, fileitem: schemas.FileItem, path: Path, new_name: str = None) -> Optional[schemas.FileItem]:
|
def upload(self, fileitem: schemas.FileItem, path: Path, new_name: str = None) -> Optional[schemas.FileItem]:
|
||||||
"""
|
"""
|
||||||
上传文件
|
上传文件
|
||||||
|
:param fileitem: 上传目录项
|
||||||
|
:param path: 本地文件路径
|
||||||
|
:param new_name: 上传后文件名
|
||||||
"""
|
"""
|
||||||
if not self.client:
|
if not self.client:
|
||||||
return None
|
return None
|
||||||
|
|||||||
Reference in New Issue
Block a user