From a13d32c17f108556c09a34d1ebee99aaf55e7be8 Mon Sep 17 00:00:00 2001 From: Akimio521 Date: Sat, 31 Aug 2024 13:32:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=B0=86history.episodes=E8=BD=AC=E6=8D=A2?= =?UTF-8?q?=E6=88=90episode=5Fdetail?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/endpoints/transfer.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/api/endpoints/transfer.py b/app/api/endpoints/transfer.py index 56e79744..b9a2a721 100644 --- a/app/api/endpoints/transfer.py +++ b/app/api/endpoints/transfer.py @@ -115,7 +115,17 @@ def manual_transfer(fileitem: FileItem = None, tmdbid = int(history.tmdbid) if history.tmdbid else tmdbid doubanid = str(history.doubanid) if history.doubanid else doubanid season = int(str(history.seasons).replace("S", "")) if history.seasons else season - episode_detail = str(history.episodes) if history.episodes else episode_detail + if history.episodes: + if "-" in str(history.episodes): + # E01-E03多集合并 + episode_start, episode_end = str(history.episodes).split("-") + episode_list: list[int] = [] + for i in range(int(episode_start.replace("E", "")), int(episode_end.replace("E", "")) + 1): + episode_list.append(i) + episode_detail = ",".join(str(e) for e in episode_list) + else: + # E01单集 + episode_detail = str(history.episodes).replace("E", "") elif fileitem: src_fileitem = fileitem