diff --git a/src/App.vue b/src/App.vue index 079d7c2..340e81e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -16,6 +16,13 @@ + + 歌曲命名格式: + 歌曲名 + 歌手-歌曲名 + 歌曲名-歌手 + + 下载全部 删除全部 @@ -96,6 +103,7 @@ tableData: [], playing_url: "", playing_auto: false, + format: '2', } }, mounted() { @@ -153,7 +161,20 @@ handleDownload(row) { let a = document.createElement('a'); a.href = row.file; - a.download = row.filename; + switch(this.format) { + case "1": + a.download = row.title + "." + row.ext; + break; + case "2": + a.download = row.artist + " - " + row.title + "." + row.ext; + break; + case "3": + a.download = row.title + " - " + row.artist + "." + row.ext; + break; + default: + a.download = row.filename; + break; + } document.body.append(a); a.click(); a.remove(); diff --git a/src/decrypt/mflac.js b/src/decrypt/mflac.js index c476f9b..c30a606 100644 --- a/src/decrypt/mflac.js +++ b/src/decrypt/mflac.js @@ -36,6 +36,7 @@ async function Decrypt(file, raw_filename, raw_ext) { filename: info.filename, title: info.title, artist: info.artist, + ext: 'flac', album: tag.common.album, picture: picUrl, file: musicUrl, diff --git a/src/decrypt/ncm.js b/src/decrypt/ncm.js index a8731bd..5778629 100644 --- a/src/decrypt/ncm.js +++ b/src/decrypt/ncm.js @@ -56,6 +56,7 @@ async function Decrypt(file) { filename: filename, title: musicMeta.musicName, artist: artists.join(" & "), + ext: musicMeta.format, album: musicMeta.album, picture: musicMeta.albumPic, file: musicUrl, diff --git a/src/decrypt/qmc.js b/src/decrypt/qmc.js index ff8478d..64f890f 100644 --- a/src/decrypt/qmc.js +++ b/src/decrypt/qmc.js @@ -50,6 +50,7 @@ async function Decrypt(file, raw_filename, raw_ext) { filename: info.filename, title: info.title, artist: info.artist, + ext: new_ext, album: tag.common.album, picture: picUrl, file: musicUrl, diff --git a/src/decrypt/raw.js b/src/decrypt/raw.js index 748b3fe..c957f60 100644 --- a/src/decrypt/raw.js +++ b/src/decrypt/raw.js @@ -17,6 +17,7 @@ async function Decrypt(file, raw_filename, raw_ext) { filename: info.filename, title: info.title, artist: info.artist, + ext: raw_ext, album: tag.common.album, picture: picUrl, file: fileUrl, diff --git a/src/main.js b/src/main.js index fc70151..174e97a 100644 --- a/src/main.js +++ b/src/main.js @@ -1,8 +1,11 @@ import Vue from 'vue' +import { Radio } from 'element-ui' import App from './App.vue' import './registerServiceWorker' import './plugins/element.js' +Vue.component(Radio.name, Radio) + // only if your build system can import css, otherwise import it wherever you would import your css. Vue.config.productionTip = false;