音乐改成数据库形式(防止内存爆炸)

新增FFmpeg获取元数据方式(无法保证所有数据都能获取到)
预置音乐收藏夹功能
机器人登录后向群里通告
移除广告相关接口
This commit is contained in:
yutou
2020-11-27 18:33:21 +08:00
parent 68bf2d96fb
commit fb9f02a751
22 changed files with 3375 additions and 407 deletions

View File

@@ -46,7 +46,7 @@
<link rel="stylesheet" href="/css/AudioPlayer.css">
<script src="/js/AudioPlayer.js"></script>
<script id="listTemplet">
{{# if(d.dir){ }}
{{# if(d.isdir===1){ }}
<div><i class="layui-icon">&#xe656; </i>{{d.title}}</div>
{{# } else { }}
<div><i class="layui-icon">&#xe6fc; </i>{{d.title}}</div>
@@ -66,8 +66,9 @@
try {
let json = JSON.parse(obj);
localhost = json.data+":8000";
if(localhost==='http://null:8000'){
localhost=""
console.log("音频地址:"+localhost)
if(localhost==='http://null:8000'||localhost===":8000"){
localhost="http://127.0.0.1"
}
} catch (e) {
localhost = ""
@@ -95,7 +96,7 @@
})
table.on('rowDouble(music)', function (obj) {
//obj 同上
if (obj.data.dir) {
if (obj.data.isdir===1) {
listTable.reload({
where: {
path: obj.data.file
@@ -115,7 +116,7 @@
table.on('tool(music)', function (obj) {
let data = obj.data;
if (obj.event === 'download') {
if (!data.dir) {
if (data.isdir===0) {
window.open(localhost + "/nas/music/play.do?token=PlVodzYhvxRQbOHKakpKs2dvnoc43Cnk&random=false&filePath=" + new Base64().encode(data.file))
}
} else if (obj.event === 'play') {
@@ -185,7 +186,7 @@
if (playIndex === musicLib.length) {
playIndex = 0;
}
if (musicLib[playIndex].dir) {
if (musicLib[playIndex].isdir===1) {
playIndex++
playNext()
} else {