mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-07-13 00:13:02 +08:00
fix storage
This commit is contained in:
@@ -3,15 +3,31 @@ from pathlib import Path
|
||||
from typing import Optional, List
|
||||
|
||||
from app import schemas
|
||||
from app.helper.storage import StorageHelper
|
||||
|
||||
|
||||
class StorageBase(metaclass=ABCMeta):
|
||||
"""
|
||||
存储基类
|
||||
"""
|
||||
|
||||
schema = None
|
||||
transtype = {}
|
||||
|
||||
def __init__(self):
|
||||
self.storagehelper = StorageHelper()
|
||||
|
||||
def get_config(self) -> Optional[schemas.StorageConf]:
|
||||
"""
|
||||
获取配置
|
||||
"""
|
||||
return self.storagehelper.get_storage(self.schema.value)
|
||||
|
||||
def set_config(self, conf: dict):
|
||||
"""
|
||||
设置配置
|
||||
"""
|
||||
self.storagehelper.set_storage(self.schema.value, conf)
|
||||
|
||||
def support_transtype(self) -> dict:
|
||||
"""
|
||||
支持的整理方式
|
||||
|
||||
Reference in New Issue
Block a user