mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-02-03 10:35:15 +08:00
fix
This commit is contained in:
@@ -27,15 +27,12 @@ class MediaChain(ChainBase):
|
||||
媒体信息处理链,单例运行
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self._systemconfig = SystemConfigOper()
|
||||
|
||||
def _get_scraping_switchs(self) -> dict:
|
||||
@staticmethod
|
||||
def _get_scraping_switchs() -> dict:
|
||||
"""
|
||||
获取刮削开关配置
|
||||
"""
|
||||
switchs = self._systemconfig.get(SystemConfigKey.ScrapingSwitchs) or {}
|
||||
switchs = SystemConfigOper().get(SystemConfigKey.ScrapingSwitchs) or {}
|
||||
# 默认配置
|
||||
default_switchs = {
|
||||
'movie_nfo': True, # 电影NFO
|
||||
@@ -63,13 +60,14 @@ class MediaChain(ChainBase):
|
||||
switchs[key] = default_value
|
||||
return switchs
|
||||
|
||||
def set_scraping_switchs(self, switchs: dict) -> bool:
|
||||
@staticmethod
|
||||
def set_scraping_switchs(switchs: dict) -> bool:
|
||||
"""
|
||||
设置刮削开关配置
|
||||
:param switchs: 开关配置字典
|
||||
:return: 是否设置成功
|
||||
"""
|
||||
return self._systemconfig.set(SystemConfigKey.ScrapingSwitchs, switchs)
|
||||
return SystemConfigOper().set(SystemConfigKey.ScrapingSwitchs, switchs)
|
||||
|
||||
def metadata_nfo(self, meta: MetaBase, mediainfo: MediaInfo,
|
||||
season: Optional[int] = None, episode: Optional[int] = None) -> Optional[str]:
|
||||
|
||||
@@ -306,7 +306,6 @@ class QbittorrentModule(_ModuleBase, _DownloaderBase[Qbittorrent]):
|
||||
))
|
||||
else:
|
||||
return None
|
||||
return ret_torrents
|
||||
|
||||
def transfer_completed(self, hashs: str, downloader: Optional[str] = None) -> None:
|
||||
"""
|
||||
@@ -318,6 +317,7 @@ class QbittorrentModule(_ModuleBase, _DownloaderBase[Qbittorrent]):
|
||||
if not server:
|
||||
return None
|
||||
server.set_torrents_tag(ids=hashs, tags=['已整理'])
|
||||
return None
|
||||
|
||||
def remove_torrents(self, hashs: Union[str, list], delete_file: Optional[bool] = True,
|
||||
downloader: Optional[str] = None) -> Optional[bool]:
|
||||
|
||||
@@ -292,7 +292,6 @@ class TransmissionModule(_ModuleBase, _DownloaderBase[Transmission]):
|
||||
))
|
||||
else:
|
||||
return None
|
||||
return ret_torrents
|
||||
|
||||
def transfer_completed(self, hashs: str, downloader: Optional[str] = None) -> None:
|
||||
"""
|
||||
@@ -312,6 +311,7 @@ class TransmissionModule(_ModuleBase, _DownloaderBase[Transmission]):
|
||||
else:
|
||||
tags = ['已整理']
|
||||
server.set_torrent_tag(ids=hashs, tags=tags)
|
||||
return None
|
||||
|
||||
def remove_torrents(self, hashs: Union[str, list], delete_file: Optional[bool] = True,
|
||||
downloader: Optional[str] = None) -> Optional[bool]:
|
||||
|
||||
Reference in New Issue
Block a user