From 2682a808151ca12b4a4b09c10d352ab1b48b7080 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Wed, 23 Aug 2023 12:50:08 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E8=BD=AC=E7=A7=BB=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/chain/subscribe.py | 2 +- app/chain/transfer.py | 6 +++--- app/db/transferhistory_oper.py | 6 +----- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/app/chain/subscribe.py b/app/chain/subscribe.py index 51349e5d..b1a82f1d 100644 --- a/app/chain/subscribe.py +++ b/app/chain/subscribe.py @@ -424,7 +424,7 @@ class SubscribeChain(ChainBase): # 回收资源 del torrents else: - logger.info(f'{indexer.get("name")} 获取到种子') + logger.info(f'{indexer.get("name")} 没有获取到种子') # 从缓存中匹配订阅 self.match(torrents_cache) # 保存缓存到本地 diff --git a/app/chain/transfer.py b/app/chain/transfer.py index 5c3f99e3..9040647d 100644 --- a/app/chain/transfer.py +++ b/app/chain/transfer.py @@ -330,7 +330,7 @@ class TransferChain(ChainBase): """ 新增转移成功历史记录 """ - self.transferhis.add_force( + self.transferhis.add( src=str(src_path), dest=str(transferinfo.target_path), mode=settings.TRANSFER_TYPE, @@ -356,7 +356,7 @@ class TransferChain(ChainBase): 新增转移失败历史记录,不能按download_hash判重 """ if mediainfo and transferinfo: - his = self.transferhis.add_force( + his = self.transferhis.add( src=str(src_path), dest=str(transferinfo.target_path), mode=settings.TRANSFER_TYPE, @@ -377,7 +377,7 @@ class TransferChain(ChainBase): files=json.dumps(transferinfo.file_list) ) else: - his = self.transferhis.add_force( + his = self.transferhis.add( src=str(src_path), mode=settings.TRANSFER_TYPE, seasons=meta.season, diff --git a/app/db/transferhistory_oper.py b/app/db/transferhistory_oper.py index 529600e1..6c0774ae 100644 --- a/app/db/transferhistory_oper.py +++ b/app/db/transferhistory_oper.py @@ -35,10 +35,6 @@ class TransferHistoryOper(DbOper): """ 新增转移历史 """ - if kwargs.get("download_hash"): - transferhistory = TransferHistory.get_by_hash(self._db, kwargs.get("download_hash")) - if transferhistory: - transferhistory.delete(self._db, transferhistory.id) kwargs.update({ "date": time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) }) @@ -76,7 +72,7 @@ class TransferHistoryOper(DbOper): def add_force(self, **kwargs): """ - 新增转移历史 + 新增转移历史,相同源目录的记录会被删除 """ if kwargs.get("src"): transferhistory = TransferHistory.get_by_src(self._db, kwargs.get("src"))