From 1c4329f0b48caef3ba19f7bd26cfb3ba7c0d6807 Mon Sep 17 00:00:00 2001 From: thsrite Date: Fri, 29 Dec 2023 21:55:39 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=88=A0=E9=99=A4=E5=B7=B2=E6=9C=89?= =?UTF-8?q?=E6=8A=A5=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/embyreporter/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/embyreporter/__init__.py b/plugins/embyreporter/__init__.py index 7fe43cb..161e1f0 100644 --- a/plugins/embyreporter/__init__.py +++ b/plugins/embyreporter/__init__.py @@ -371,8 +371,9 @@ class EmbyReporter(_PluginBase): movies.extend([] * (5 - len(movies))) all_ranks = movies + tvshows - index, offset_y = (0, 0) + index, offset_y = (-1, 0) for i in all_ranks: + index += 1 try: # 榜单项数据 user_id, item_id, item_type, name, count, duarion = tuple(i) @@ -417,12 +418,13 @@ class EmbyReporter(_PluginBase): 353 + offset_y), str(count), font_count, 126) self.draw_text_psd_style(text, (74 + 145 * index, 542 + font_offset_y + offset_y), name, temp_font, 126) - index += 1 except Exception: continue if index > 0: save_path = "/public/report.jpg" + if Path(save_path).exists(): + Path.unlink(Path(save_path)) bg.save(save_path) return save_path return None