From 1c1447b49a91d7b25736900ef2cb7ed078c2c434 Mon Sep 17 00:00:00 2001 From: binaryify Date: Wed, 12 Jun 2024 15:28:25 +0800 Subject: [PATCH] update: bump tp 4.20.0 --- CHANGELOG.MD | 4 ++++ module/cloud.js | 7 +++++-- package.json | 2 +- plugins/songUpload.js | 7 +++++-- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 1c5feda..fddce8c 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -1,4 +1,8 @@ # 更新日志 +### 4.20.0 | 2024.06.12 +- 一起听从机模式完善 [#8](https://gitlab.com/Binaryify/neteasecloudmusicapi/-/merge_requests/8) +- 云盘上传后缀名判断完善 + ### 4.19.9 | 2024.05.31 - 云盘上传中文乱码问题修复 [#9](https://gitlab.com/Binaryify/neteasecloudmusicapi/-/issues/9) diff --git a/module/cloud.js b/module/cloud.js index 0dd7f7a..f51c0a1 100644 --- a/module/cloud.js +++ b/module/cloud.js @@ -3,8 +3,11 @@ const uploadPlugin = require('../plugins/songUpload') const md5 = require('md5') module.exports = async (query, request) => { let ext = 'mp3' - if (query.songFile.name.indexOf('flac') > -1) { - ext = 'flac' + // if (query.songFile.name.indexOf('flac') > -1) { + // ext = 'flac' + // } + if (query.songFile.name.includes('.')) { + ext = query.songFile.name.split('.').pop() } query.songFile.name = Buffer.from(query.songFile.name, 'latin1').toString( 'utf-8', diff --git a/package.json b/package.json index 792e7b5..eadf6d5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "NeteaseCloudMusicApi", - "version": "4.19.9", + "version": "4.20.0", "description": "网易云音乐 NodeJS 版 API", "scripts": { "start": "node app.js", diff --git a/plugins/songUpload.js b/plugins/songUpload.js index 56391af..c5231f4 100644 --- a/plugins/songUpload.js +++ b/plugins/songUpload.js @@ -1,8 +1,11 @@ const { default: axios } = require('axios') module.exports = async (query, request) => { let ext = 'mp3' - if (query.songFile.name.indexOf('flac') > -1) { - ext = 'flac' + // if (query.songFile.name.indexOf('flac') > -1) { + // ext = 'flac' + // } + if (query.songFile.name.includes('.')) { + ext = query.songFile.name.split('.').pop() } const filename = query.songFile.name .replace('.' + ext, '')