From 9ffe68f1977341cd8d453862502716ad5d8fe4aa Mon Sep 17 00:00:00 2001 From: thsrite Date: Wed, 10 Jan 2024 12:19:51 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=97=B6=E9=95=BF=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/embyreporter/__init__.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/embyreporter/__init__.py b/plugins/embyreporter/__init__.py index 3ec91dc..558f425 100644 --- a/plugins/embyreporter/__init__.py +++ b/plugins/embyreporter/__init__.py @@ -20,6 +20,7 @@ from cacheout import Cache from datetime import datetime, timedelta from app.utils.http import RequestUtils +from app.utils.string import StringUtils cache = Cache() @@ -557,7 +558,7 @@ class EmbyReporter(_PluginBase): try: # 榜单项数据 user_id, item_id, item_type, name, count, duration = tuple(i) - print(item_type, item_id, name, count, f"{round(int(duration) / 60, 2)}min") + print(item_type, item_id, name, count, StringUtils.str_secends(int(duration))) # 封面图像获取 success, data = self.primary(item_id) if not success: @@ -579,7 +580,7 @@ class EmbyReporter(_PluginBase): try: # 榜单项数据 user_id, item_id, item_type, name, count, duration = tuple(i) - print(item_type, item_id, name, count, f"{round(int(duration) / 60, 2)}min") + print(item_type, item_id, name, count, StringUtils.str_secends(int(duration))) # 图片获取,剧集主封面获取 # 获取剧ID success, data = self.items(user_id, item_id) @@ -644,9 +645,9 @@ class EmbyReporter(_PluginBase): if show_time: self.draw_text_psd_style(text, (177 + 145 * index - font_count.getlength( - f"{round(int(duration) / 60, 2)}min"), + StringUtils.str_secends(int(duration))), 353 + offset_y), - f"{round(int(duration) / 60, 2)}min", font_count, 126) + StringUtils.str_secends(int(duration)), font_count, 126) self.draw_text_psd_style(text, (74 + 145 * index, 542 + font_offset_y + offset_y), name, temp_font, 126) except Exception: continue