From 50887ce1fdfe866913163729ffc575e80b5accad Mon Sep 17 00:00:00 2001 From: wushuo Date: Tue, 26 Nov 2024 18:01:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=89=B9=E9=87=8F=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E7=A7=8D=E5=AD=90=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/ani/rss/action/TorrentAction.java | 7 +++++- ui/src/home/Items.vue | 25 ++++++++----------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/main/java/ani/rss/action/TorrentAction.java b/src/main/java/ani/rss/action/TorrentAction.java index fb63cafd..840de508 100644 --- a/src/main/java/ani/rss/action/TorrentAction.java +++ b/src/main/java/ani/rss/action/TorrentAction.java @@ -8,6 +8,7 @@ import ani.rss.util.TorrentUtil; import cn.hutool.core.io.FileUtil; import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; import cn.hutool.http.Method; import cn.hutool.http.server.HttpServerRequest; import cn.hutool.http.server.HttpServerResponse; @@ -15,6 +16,7 @@ import java.io.File; import java.io.IOException; +import java.util.List; import java.util.Optional; /** @@ -46,12 +48,15 @@ public void del() { resultErrorMsg("此订阅不存在"); return; } + + List infoHashList = StrUtil.split(infoHash, ",", true, true); + Ani ani = first.get(); File torrentDir = TorrentUtil.getTorrentDir(ani); File[] files = ObjectUtil.defaultIfNull(torrentDir.listFiles(), new File[]{}); for (File file : files) { String s = FileUtil.mainName(file); - if (infoHash.equals(s)) { + if (infoHashList.contains(s)) { log.info("删除种子 {}", file); FileUtil.del(file); } diff --git a/ui/src/home/Items.vue b/ui/src/home/Items.vue index 20ad531c..6e8549f3 100644 --- a/ui/src/home/Items.vue +++ b/ui/src/home/Items.vue @@ -15,6 +15,14 @@ 允许下载 禁止下载 + + +
复制 - - -
@@ -146,8 +142,9 @@ let load = () => { }) } -let delTorrent = (item) => { - api.del(`api/torrent?id=${props.ani.id}&infoHash=${item['infoHash']}`) +let delTorrent = () => { + let infoHash = selectViews.value.filter(it => it['local']).map(it => it['infoHash']).join(",") + api.del(`api/torrent?id=${props.ani.id}&infoHash=${infoHash}`) .then(res => { ElMessage.success(res.message) load()