fix 下载用户精简下载进度消息

This commit is contained in:
thsrite 2023-10-13 13:56:23 +08:00
parent b6c3c03748
commit eec52fa5ba

View File

@ -117,7 +117,7 @@ class DownloadingMsg(_PluginBase):
if not userid: if not userid:
continue continue
# 如果用户是管理员,无需重复推送 # 如果用户是管理员,无需重复推送
if self._type == "admin" or self._type == "both" and self._adminuser and userid in str( if (self._type == "admin" or self._type == "both") and self._adminuser and userid in str(
self._adminuser).split(","): self._adminuser).split(","):
logger.debug("管理员已推送") logger.debug("管理员已推送")
continue continue
@ -177,10 +177,14 @@ class DownloadingMsg(_PluginBase):
else: else:
media_name = torrent.title media_name = torrent.title
messages.append(f"{index}. {media_name}\n" if not self._adminuser or userid not in str(self._adminuser).split(","):
f"{torrent.title} " # 下载用户发送精简消息
f"{StringUtils.str_filesize(torrent.size)} " messages.append(f"{index}. {media_name} {round(torrent.progress, 1)}%")
f"{round(torrent.progress, 1)}%") else:
messages.append(f"{index}. {media_name}\n"
f"{torrent.title} "
f"{StringUtils.str_filesize(torrent.size)} "
f"{round(torrent.progress, 1)}%")
index += 1 index += 1
# 用户消息渠道 # 用户消息渠道