fix 开关位置
This commit is contained in:
parent
79c708c30e
commit
2de20f601b
@ -257,10 +257,8 @@ class ChainBase(metaclass=ABCMeta):
|
||||
:param download_dir: 下载目录
|
||||
:return: None,该方法可被多个模块同时处理
|
||||
"""
|
||||
if settings.DOWNLOAD_SUBTITLE:
|
||||
return self.run_module("download_added", context=context, torrent_path=torrent_path,
|
||||
download_dir=download_dir)
|
||||
return None
|
||||
|
||||
def list_torrents(self, status: TorrentStatus = None,
|
||||
hashs: Union[list, str] = None) -> Optional[List[Union[TransferTorrent, DownloadingTorrent]]]:
|
||||
@ -342,9 +340,7 @@ class ChainBase(metaclass=ABCMeta):
|
||||
:param file_path: 文件路径
|
||||
:return: 成功或失败
|
||||
"""
|
||||
if settings.REFRESH_MEDIASERVER:
|
||||
return self.run_module("refresh_mediaserver", mediainfo=mediainfo, file_path=file_path)
|
||||
return None
|
||||
|
||||
def post_message(self, message: Notification) -> None:
|
||||
"""
|
||||
@ -385,17 +381,14 @@ class ChainBase(metaclass=ABCMeta):
|
||||
"""
|
||||
return self.run_module("post_torrents_message", message=message, torrents=torrents)
|
||||
|
||||
def scrape_metadata(self, path: Path, mediainfo: MediaInfo, scrap: bool = settings.SCRAP_METADATA) -> None:
|
||||
def scrape_metadata(self, path: Path, mediainfo: MediaInfo) -> None:
|
||||
"""
|
||||
刮削元数据
|
||||
:param path: 媒体文件路径
|
||||
:param mediainfo: 识别的媒体信息
|
||||
:param scrap: 是否刮削
|
||||
:return: 成功或失败
|
||||
"""
|
||||
if scrap:
|
||||
return self.run_module("scrape_metadata", path=path, mediainfo=mediainfo)
|
||||
return None
|
||||
|
||||
def register_commands(self, commands: Dict[str, dict]) -> None:
|
||||
"""
|
||||
|
@ -349,6 +349,7 @@ class TransferChain(ChainBase):
|
||||
transferinfo=transferinfo
|
||||
)
|
||||
# 刮削单个文件
|
||||
if settings.SCRAP_METADATA:
|
||||
self.scrape_metadata(path=transferinfo.target_path, mediainfo=file_mediainfo)
|
||||
# 更新进度
|
||||
processed_num += 1
|
||||
@ -369,6 +370,7 @@ class TransferChain(ChainBase):
|
||||
if transfer_info.target_path.is_file():
|
||||
transfer_info.target_path = transfer_info.target_path.parent
|
||||
# 刷新媒体库,根目录或季目录
|
||||
if settings.REFRESH_MEDIASERVER:
|
||||
self.refresh_mediaserver(mediainfo=media, file_path=transfer_info.target_path)
|
||||
# 发送通知
|
||||
se_str = None
|
||||
|
@ -42,6 +42,9 @@ class SubtitleModule(_ModuleBase):
|
||||
:param download_dir: 下载目录
|
||||
:return: None,该方法可被多个模块同时处理
|
||||
"""
|
||||
if not settings.DOWNLOAD_SUBTITLE:
|
||||
return None
|
||||
|
||||
# 种子信息
|
||||
torrent = context.torrent_info
|
||||
if not torrent.page_url:
|
||||
|
@ -323,6 +323,7 @@ class DirMonitor(_PluginBase):
|
||||
)
|
||||
|
||||
# 刮削单个文件
|
||||
if settings.SCRAP_METADATA:
|
||||
self.chain.scrape_metadata(path=transferinfo.target_path,
|
||||
mediainfo=mediainfo)
|
||||
|
||||
@ -386,6 +387,7 @@ class DirMonitor(_PluginBase):
|
||||
self._medias[mediainfo.title_year + " " + meta.season] = media_list
|
||||
|
||||
# 汇总刷新媒体库
|
||||
if settings.REFRESH_MEDIASERVER:
|
||||
self.chain.refresh_mediaserver(mediainfo=mediainfo, file_path=transferinfo.target_path)
|
||||
# 广播事件
|
||||
self.eventmanager.send_event(EventType.TransferComplete, {
|
||||
|
@ -384,7 +384,8 @@ class LibraryScraper(_PluginBase):
|
||||
print(str(err))
|
||||
|
||||
# 刮削单个文件
|
||||
self.chain.scrape_metadata(path=file, mediainfo=mediainfo, scrap=scrap_metadata)
|
||||
if scrap_metadata:
|
||||
self.chain.scrape_metadata(path=file, mediainfo=mediainfo)
|
||||
|
||||
@staticmethod
|
||||
def __get_tmdbid_from_nfo(file_path: Path):
|
||||
|
Loading…
x
Reference in New Issue
Block a user