refactor: get_parent

This commit is contained in:
jxxghp
2024-10-23 17:47:01 +08:00
parent a4419796ac
commit a6f0792014
2 changed files with 12 additions and 11 deletions

View File

@@ -81,6 +81,12 @@ class StorageBase(metaclass=ABCMeta):
"""
pass
def get_parent(self, fileitem: schemas.FileItem) -> Optional[schemas.FileItem]:
"""
获取父目录
"""
return self.get_folder(Path(fileitem.path).parent)
@abstractmethod
def delete(self, fileitem: schemas.FileItem) -> bool:
"""