fix text
This commit is contained in:
parent
91e3788b73
commit
45faf0cf18
@ -104,16 +104,16 @@ class TorrentTransfer(_PluginBase):
|
|||||||
return
|
return
|
||||||
self._scheduler = BackgroundScheduler(timezone=settings.TZ)
|
self._scheduler = BackgroundScheduler(timezone=settings.TZ)
|
||||||
if self._cron:
|
if self._cron:
|
||||||
logger.info(f"移转做种服务启动,周期:{self._cron}")
|
logger.info(f"转移做种服务启动,周期:{self._cron}")
|
||||||
try:
|
try:
|
||||||
self._scheduler.add_job(self.transfer,
|
self._scheduler.add_job(self.transfer,
|
||||||
CronTrigger.from_crontab(self._cron))
|
CronTrigger.from_crontab(self._cron))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"移转做种服务启动失败:{e}")
|
logger.error(f"转移做种服务启动失败:{e}")
|
||||||
self.systemmessage(f"移转做种服务启动失败:{e}")
|
self.systemmessage(f"转移做种服务启动失败:{e}")
|
||||||
return
|
return
|
||||||
if self._onlyonce:
|
if self._onlyonce:
|
||||||
logger.info(f"移转做种服务启动,立即运行一次")
|
logger.info(f"转移做种服务启动,立即运行一次")
|
||||||
self._scheduler.add_job(self.transfer, 'date',
|
self._scheduler.add_job(self.transfer, 'date',
|
||||||
run_date=datetime.now(tz=pytz.timezone(settings.TZ)) + timedelta(
|
run_date=datetime.now(tz=pytz.timezone(settings.TZ)) + timedelta(
|
||||||
seconds=3))
|
seconds=3))
|
||||||
@ -481,9 +481,9 @@ class TorrentTransfer(_PluginBase):
|
|||||||
|
|
||||||
def transfer(self):
|
def transfer(self):
|
||||||
"""
|
"""
|
||||||
开始移转做种
|
开始转移做种
|
||||||
"""
|
"""
|
||||||
logger.info("开始移转做种任务 ...")
|
logger.info("开始转移做种任务 ...")
|
||||||
|
|
||||||
# 源下载器
|
# 源下载器
|
||||||
downloader = self._fromdownloader
|
downloader = self._fromdownloader
|
||||||
@ -503,7 +503,7 @@ class TorrentTransfer(_PluginBase):
|
|||||||
trans_torrents = []
|
trans_torrents = []
|
||||||
for torrent in torrents:
|
for torrent in torrents:
|
||||||
if self._event.is_set():
|
if self._event.is_set():
|
||||||
logger.info(f"移转服务停止")
|
logger.info(f"转移服务停止")
|
||||||
return
|
return
|
||||||
|
|
||||||
# 获取种子hash
|
# 获取种子hash
|
||||||
@ -512,11 +512,11 @@ class TorrentTransfer(_PluginBase):
|
|||||||
save_path = self.__get_save_path(torrent, downloader)
|
save_path = self.__get_save_path(torrent, downloader)
|
||||||
|
|
||||||
if self._nopaths and save_path:
|
if self._nopaths and save_path:
|
||||||
# 过滤不需要移转的路径
|
# 过滤不需要转移的路径
|
||||||
nopath_skip = False
|
nopath_skip = False
|
||||||
for nopath in self._nopaths.split('\n'):
|
for nopath in self._nopaths.split('\n'):
|
||||||
if os.path.normpath(save_path).startswith(os.path.normpath(nopath)):
|
if os.path.normpath(save_path).startswith(os.path.normpath(nopath)):
|
||||||
logger.info(f"种子 {hash_str} 保存路径 {save_path} 不需要移转,跳过 ...")
|
logger.info(f"种子 {hash_str} 保存路径 {save_path} 不需要转移,跳过 ...")
|
||||||
nopath_skip = True
|
nopath_skip = True
|
||||||
break
|
break
|
||||||
if nopath_skip:
|
if nopath_skip:
|
||||||
@ -543,7 +543,7 @@ class TorrentTransfer(_PluginBase):
|
|||||||
|
|
||||||
# 开始转移任务
|
# 开始转移任务
|
||||||
if trans_torrents:
|
if trans_torrents:
|
||||||
logger.info(f"需要移转的种子数:{len(trans_torrents)}")
|
logger.info(f"需要转移的种子数:{len(trans_torrents)}")
|
||||||
# 记数
|
# 记数
|
||||||
total = len(trans_torrents)
|
total = len(trans_torrents)
|
||||||
# 总成功数
|
# 总成功数
|
||||||
@ -652,12 +652,12 @@ class TorrentTransfer(_PluginBase):
|
|||||||
if self._notify:
|
if self._notify:
|
||||||
self.post_message(
|
self.post_message(
|
||||||
mtype=NotificationType.SiteMessage,
|
mtype=NotificationType.SiteMessage,
|
||||||
title="【移转做种任务执行完成】",
|
title="【转移做种任务执行完成】",
|
||||||
text=f"总数:{total},成功:{success},失败:{fail}"
|
text=f"总数:{total},成功:{success},失败:{fail}"
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
logger.info(f"没有需要移转的种子")
|
logger.info(f"没有需要转移的种子")
|
||||||
logger.info("移转做种任务执行完成")
|
logger.info("转移做种任务执行完成")
|
||||||
|
|
||||||
def check_recheck(self):
|
def check_recheck(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user