From 9c6af8ff9cfa743e87eb33f611a6d912df109fb8 Mon Sep 17 00:00:00 2001 From: smdev Date: Tue, 4 Feb 2020 18:24:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=AD=8C=E6=9B=B2=E5=91=BD?= =?UTF-8?q?=E5=90=8D=E6=A0=BC=E5=BC=8F=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 23 ++++++++++++++++++++++- src/decrypt/mflac.js | 1 + src/decrypt/ncm.js | 1 + src/decrypt/qmc.js | 1 + src/decrypt/raw.js | 1 + src/main.js | 3 +++ 6 files changed, 29 insertions(+), 1 deletion(-) 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;