#19 Add Download Type: Origin Filename

remotes/origin/HEAD
MengYX 5 years ago
parent 9fd7177ebb
commit 984b549448
No known key found for this signature in database
GPG Key ID: E63F9C7303E8F604

@ -7,10 +7,10 @@
<el-row id="app-control">
<el-row style="padding-bottom: 1em; font-size: 14px">
歌曲命名格式
<el-radio name="format" v-model="download_format" label="1"></el-radio>
<el-radio name="format" v-model="download_format" label="2">-</el-radio>
<el-radio name="format" v-model="download_format" label="3">-</el-radio>
<el-checkbox v-model="instant_download" border>立即保存</el-checkbox>
<el-radio label="1" name="format" v-model="download_format">-</el-radio>
<el-radio label="2" name="format" v-model="download_format"></el-radio>
<el-radio label="3" name="format" v-model="download_format">-</el-radio>
<el-radio label="4" name="format" v-model="download_format"></el-radio>
</el-row>
<el-row>
<el-button @click="handleDownloadAll" icon="el-icon-download" plain>下载全部</el-button>
@ -65,7 +65,7 @@
tableData: [],
playing_url: "",
playing_auto: false,
download_format: '2',
download_format: '1',
instant_download: false,
}
},

@ -2,16 +2,19 @@ export function DownloadBlobMusic(data, format) {
const a = document.createElement('a');
a.href = data.file;
switch (format) {
default:
case "1":
a.download = data.title + "." + data.ext;
a.download = data.artist + " - " + data.title + "." + data.ext;
break;
default:
case "2":
a.download = data.artist + " - " + data.title + "." + data.ext;
a.download = data.title + "." + data.ext;
break;
case "3":
a.download = data.title + " - " + data.artist + "." + data.ext;
break;
case "4":
a.download = data.rawFilename + "." + data.ext;
break;
}
document.body.append(a);
a.click();

Loading…
Cancel
Save