From 459ce8aeb2d1430ee9753336851ece64c6f418c4 Mon Sep 17 00:00:00 2001 From: src48597962 <48597962@qq.com> Date: Thu, 9 Mar 2023 10:06:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'SrcJyAlist.js'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SrcJyAlist.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/SrcJyAlist.js b/SrcJyAlist.js index 19118ab2..935f3163 100644 --- a/SrcJyAlist.js +++ b/SrcJyAlist.js @@ -474,19 +474,19 @@ function alistSearch(alistapi,input) { let txt = pdfh(item,"a&&href"); let parent = txt.substring(0,txt.lastIndexOf("/")); let name = txt.substring(txt.lastIndexOf('/')+1); - let suffix = name.substring(txt.length-5,txt.length); - if((suffix.indexOf('.')==-1 || !contain.test(suffix))){ + let suffix = name.substring(txt.lastIndexOf('.')+1); + if(suffix.length>3 && !contain.test(suffix) && !dirlist.some(d => d.parent+'/'+d.name==parent)){ dirlist.push({ "parent": parent, "name": name, "is_dir": true }) - }else if(contain.test(suffix)){ - filelist.push({ + }else if(contain.test(suffix) && !dirlist.some(d => d.parent+'/'+d.name==parent)){ + filelist.push({ "parent": parent, "name": name, "is_dir": false - }) + }) } }) }catch(e){