提交 c6af71ca 编写于 作者: H hjdhnx

alist

上级 b13b59b8
无法预览此类型文件
3.9.27beta1 3.9.27beta2
\ No newline at end of file \ No newline at end of file
...@@ -124,14 +124,14 @@ function init(ext) { ...@@ -124,14 +124,14 @@ function init(ext) {
const data = http.get(alist_data_url).json(); // .map(it=>{it.name='🙋丫仙女';return it}) const data = http.get(alist_data_url).json(); // .map(it=>{it.name='🙋丫仙女';return it})
// print(data); // 测试证明壳子标题支持emoji,是http请求源码不支持emoji // print(data); // 测试证明壳子标题支持emoji,是http请求源码不支持emoji
let drives = []; let drives = [];
if(Array.isArray(data) && data.length > 1 && data[0].hasOwnProperty('server') && data[0].hasOwnProperty('name')){ if(Array.isArray(data) && data.length > 0 && data[0].hasOwnProperty('server') && data[0].hasOwnProperty('name')){
drives = data; drives = data;
}else if(!Array.isArray(data)&&data.hasOwnProperty('drives')&&Array.isArray(data.drives)){ }else if(!Array.isArray(data)&&data.hasOwnProperty('drives')&&Array.isArray(data.drives)){
drives = data.drives.filter(it=>(it.type&&it.type==='alist')||!it.type); drives = data.drives.filter(it=>(it.type&&it.type==='alist')||!it.type);
} }
print(drives); print(drives);
searchDriver = (drives.find(x=>x.search)||{}).name||''; searchDriver = (drives.find(x=>x.search)||{}).name||'';
if(!searchDriver && drives.length > 1){ if(!searchDriver && drives.length > 0){
searchDriver = drives[0].name; searchDriver = drives[0].name;
} }
print(searchDriver); print(searchDriver);
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册