Skip to content

Commit

Permalink
fix text
Browse files Browse the repository at this point in the history
  • Loading branch information
jxxghp committed Aug 22, 2023
1 parent 91e3788 commit 45faf0c
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions app/plugins/torrenttransfer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,16 @@ def init_plugin(self, config: dict = None):
return
self._scheduler = BackgroundScheduler(timezone=settings.TZ)
if self._cron:
logger.info(f"移转做种服务启动,周期:{self._cron}")
logger.info(f"转移做种服务启动,周期:{self._cron}")
try:
self._scheduler.add_job(self.transfer,
CronTrigger.from_crontab(self._cron))
except Exception as e:
logger.error(f"移转做种服务启动失败{e}")
self.systemmessage(f"移转做种服务启动失败{e}")
logger.error(f"转移做种服务启动失败{e}")
self.systemmessage(f"转移做种服务启动失败{e}")
return
if self._onlyonce:
logger.info(f"移转做种服务启动,立即运行一次")
logger.info(f"转移做种服务启动,立即运行一次")
self._scheduler.add_job(self.transfer, 'date',
run_date=datetime.now(tz=pytz.timezone(settings.TZ)) + timedelta(
seconds=3))
Expand Down Expand Up @@ -481,9 +481,9 @@ def __download(self, downloader: str, content: bytes,

def transfer(self):
"""
开始移转做种
开始转移做种
"""
logger.info("开始移转做种任务 ...")
logger.info("开始转移做种任务 ...")

# 源下载器
downloader = self._fromdownloader
Expand All @@ -503,7 +503,7 @@ def transfer(self):
trans_torrents = []
for torrent in torrents:
if self._event.is_set():
logger.info(f"移转服务停止")
logger.info(f"转移服务停止")
return

# 获取种子hash
Expand All @@ -512,11 +512,11 @@ def transfer(self):
save_path = self.__get_save_path(torrent, downloader)

if self._nopaths and save_path:
# 过滤不需要移转的路径
# 过滤不需要转移的路径
nopath_skip = False
for nopath in self._nopaths.split('\n'):
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
break
if nopath_skip:
Expand All @@ -543,7 +543,7 @@ def transfer(self):

# 开始转移任务
if trans_torrents:
logger.info(f"需要移转的种子数{len(trans_torrents)}")
logger.info(f"需要转移的种子数{len(trans_torrents)}")
# 记数
total = len(trans_torrents)
# 总成功数
Expand Down Expand Up @@ -652,12 +652,12 @@ def transfer(self):
if self._notify:
self.post_message(
mtype=NotificationType.SiteMessage,
title="【移转做种任务执行完成】",
title="【转移做种任务执行完成】",
text=f"总数:{total},成功:{success},失败:{fail}"
)
else:
logger.info(f"没有需要移转的种子")
logger.info("移转做种任务执行完成")
logger.info(f"没有需要转移的种子")
logger.info("转移做种任务执行完成")

def check_recheck(self):
"""
Expand Down

0 comments on commit 45faf0c

Please sign in to comment.