From 142daa9d1561c41ab2356dd219c66cc36fa6653f Mon Sep 17 00:00:00 2001 From: lostwindsenril Date: Fri, 29 Aug 2025 13:04:17 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BD=BF=E9=A6=92=E5=A4=B4=EF=BC=88m-team?= =?UTF-8?q?=EF=BC=89=E6=94=AF=E6=8C=81=E5=89=A9=E4=BD=99=E4=BF=83=E9=94=80?= =?UTF-8?q?=E6=9C=9F=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add freedate to torrent if discountEndTime exists --- app/modules/indexer/spider/mtorrent.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/modules/indexer/spider/mtorrent.py b/app/modules/indexer/spider/mtorrent.py index a4bb6ac2..192c9fa7 100644 --- a/app/modules/indexer/spider/mtorrent.py +++ b/app/modules/indexer/spider/mtorrent.py @@ -127,6 +127,8 @@ class MTorrentSpider: 'labels': labels, 'category': category } + if 'discountEndTime' in result.get('status', {}): + torrent['freedate'] = StringUtils.format_timestamp(result.get('status').get('discountEndTime')) torrents.append(torrent) return torrents From c8c671d915b2cd02a5f24763a01541c6f284d141 Mon Sep 17 00:00:00 2001 From: lostwindsenril Date: Fri, 29 Aug 2025 13:07:31 +0800 Subject: [PATCH 2/2] Update app/modules/indexer/spider/mtorrent.py Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- app/modules/indexer/spider/mtorrent.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/modules/indexer/spider/mtorrent.py b/app/modules/indexer/spider/mtorrent.py index 192c9fa7..d5f9403d 100644 --- a/app/modules/indexer/spider/mtorrent.py +++ b/app/modules/indexer/spider/mtorrent.py @@ -127,8 +127,8 @@ class MTorrentSpider: 'labels': labels, 'category': category } - if 'discountEndTime' in result.get('status', {}): - torrent['freedate'] = StringUtils.format_timestamp(result.get('status').get('discountEndTime')) + if discount_end_time := (result.get('status') or {}).get('discountEndTime'): + torrent['freedate'] = StringUtils.format_timestamp(discount_end_time) torrents.append(torrent) return torrents