mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-06-06 16:20:18 +08:00
feat(storge):添加存储重置功能
This commit is contained in:
@@ -154,6 +154,16 @@ class FileManagerModule(_ModuleBase):
|
||||
return
|
||||
storage_oper.set_config(conf)
|
||||
|
||||
def reset_config(self, storage: str) -> None:
|
||||
"""
|
||||
重置存储配置
|
||||
"""
|
||||
storage_oper = self.__get_storage_oper(storage)
|
||||
if not storage_oper:
|
||||
logger.error(f"不支持 {storage} 的重置存储配置")
|
||||
return
|
||||
storage_oper.reset_config()
|
||||
|
||||
def generate_qrcode(self, storage: str) -> Optional[Tuple[dict, str]]:
|
||||
"""
|
||||
生成二维码
|
||||
|
||||
@@ -61,6 +61,13 @@ class StorageBase(metaclass=ABCMeta):
|
||||
"""
|
||||
return transtype in self.transtype
|
||||
|
||||
def reset_config(self):
|
||||
"""
|
||||
重置置配置
|
||||
"""
|
||||
self.storagehelper.reset_storage(self.schema.value)
|
||||
self.init_storage()
|
||||
|
||||
@abstractmethod
|
||||
def check(self) -> bool:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user