add notification link

This commit is contained in:
jxxghp
2024-06-08 10:47:50 +08:00
parent 748de0ff00
commit e05c643a6b
21 changed files with 148 additions and 54 deletions

View File

@ -89,7 +89,8 @@ class DownloadChain(ChainBase):
title=f"{mediainfo.title_year} "
f"{'%s %s' % (meta.season, download_episodes) if download_episodes else meta.season_episode} 开始下载",
text=msg_text,
image=mediainfo.get_message_image()))
image=mediainfo.get_message_image(),
link=settings.MP_DOMAIN('/#/downloading')))
def download_torrent(self, torrent: TorrentInfo,
channel: MessageChannel = None,
@ -841,7 +842,9 @@ class DownloadChain(ChainBase):
channel=channel,
mtype=NotificationType.Download,
title="没有正在下载的任务!",
userid=userid))
userid=userid,
link=settings.MP_DOMAIN('#/downloading')
))
return
# 发送消息
title = f"{len(torrents)} 个任务正在下载:"
@ -853,8 +856,13 @@ class DownloadChain(ChainBase):
f"{round(torrent.progress, 1)}%")
index += 1
self.post_message(Notification(
channel=channel, mtype=NotificationType.Download,
title=title, text="\n".join(messages), userid=userid))
channel=channel,
mtype=NotificationType.Download,
title=title,
text="\n".join(messages),
userid=userid,
link=settings.MP_DOMAIN('#/downloading')
))
def downloading(self) -> List[DownloadingTorrent]:
"""