mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 23:47:41 +08:00
feat:支持新增存储类型
This commit is contained in:
@@ -50,3 +50,22 @@ class StorageHelper:
|
|||||||
s.config = conf
|
s.config = conf
|
||||||
break
|
break
|
||||||
self.systemconfig.set(SystemConfigKey.Storages, [s.dict() for s in storagies])
|
self.systemconfig.set(SystemConfigKey.Storages, [s.dict() for s in storagies])
|
||||||
|
|
||||||
|
def add_storage(self, storage: str, conf: dict):
|
||||||
|
"""
|
||||||
|
添加存储配置
|
||||||
|
"""
|
||||||
|
storagies = self.get_storagies()
|
||||||
|
if not storagies:
|
||||||
|
storagies = [
|
||||||
|
schemas.StorageConf(
|
||||||
|
type=storage,
|
||||||
|
config=conf
|
||||||
|
)
|
||||||
|
]
|
||||||
|
else:
|
||||||
|
storagies.append(schemas.StorageConf(
|
||||||
|
type=storage,
|
||||||
|
config=conf
|
||||||
|
))
|
||||||
|
self.systemconfig.set(SystemConfigKey.Storages, [s.dict() for s in storagies])
|
||||||
|
|||||||
Reference in New Issue
Block a user