11 Commits
1.3.2 ... 1.4.0

Author SHA1 Message Date
67cba29a8f chore: enhance output 2024-09-13 10:58:29 +08:00
2e5fc75fee Merge pull request #27 from um-lsr/main
fix: ncm 3.x version compatibility issues
2024-09-13 10:47:32 +08:00
鲁树人
f58c6c3880 fix: cover image memory leak
Signed-off-by: 鲁树人 <lu.shuren@um-react.app>
2024-09-13 00:01:26 +01:00
鲁树人
2b52a367f2 fix #26: correctly calculate cover frame size
Signed-off-by: 鲁树人 <lu.shuren@um-react.app>
2024-09-13 00:00:35 +01:00
36e6801f29 fix: bug report template 2024-08-17 09:01:46 +08:00
2cd7d69aa5 fix: bug report 2024-08-17 09:01:09 +08:00
1aaaab10dc feat: notice of bug report 2024-08-17 09:00:15 +08:00
e04415db9b removed: feature request template 2024-08-17 08:57:24 +08:00
911beb25bc enhanced: bug report template 2024-08-17 08:56:06 +08:00
0a6ac353ff removed: expect.bin 2024-04-17 16:56:43 +08:00
f89ea7eab6 fix: cannot process in folder 2024-04-07 13:59:03 +08:00
5 changed files with 36 additions and 50 deletions

View File

@@ -1,31 +1,35 @@
--- ---
name: Bug report name: "[请按照此模板填写] 报告 Bug"
about: Create a bug report to help us improve about: "创建一个 Bug 报告,不按照模板的 Issue 会被关闭。"
title: "[Bug] Summarize the bug here" title: "[Bug] 总结你的 Bug 报告"
labels: bug labels: bug
assignees: taurusxin assignees: taurusxin
--- ---
**Describe the bug** **Bug 描述**
A clear and concise description of what the bug is. 清晰地描述一下 Bug 的大致问题。
**To Reproduce** **复现方法**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior** 复现此 Bug 的方法
A clear and concise description of what you expected to happen.
**Screenshots** 1. 打开 '...'
If applicable, add screenshots to help explain your problem. 2. 点击 '....'
3. 发生报错
**预期行为**
解释一下原本应该出现的结果。
**屏幕截图**
如果可以,屏幕截图可以更好地阐述你的问题。
**环境**
**Desktop (please complete the following information):**
- OS: [e.g. Windows 11] - OS: [e.g. Windows 11]
- 软件版本: [e.g. 1.3.2]
**附加内容**
**Additional context** 添加更多其他内容以帮助开发者更好地了解这个 Bug。
Add any other context about the problem here.

View File

@@ -1,20 +0,0 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[Feature] Summarize new feature here"
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

View File

@@ -35,7 +35,7 @@ void processFile(const fs::path &filePath)
crypt.Dump(); crypt.Dump();
crypt.FixMetadata(); crypt.FixMetadata();
std::cout << BOLDGREEN << "Done: " << RESET << "'" << crypt.dumpFilepath().u8string() << "'" << std::endl; std::cout << BOLDGREEN << "[Done] " << RESET << "'" << filePath.u8string() << "' -> '" << crypt.dumpFilepath().u8string() << "'" << std::endl;
} }
catch (const std::invalid_argument &e) catch (const std::invalid_argument &e)
{ {
@@ -91,7 +91,7 @@ int main(int argc, char **argv)
if (i + 1 < argc && argv[i + 1][0] != '-') if (i + 1 < argc && argv[i + 1][0] != '-')
{ {
folderProvided = true; folderProvided = true;
processFilesInFolder(argv[i + 1]); processFilesInFolder(fs::u8path(argv[i + 1]));
// Skip the folder name // Skip the folder name
++i; ++i;
} }

View File

@@ -2,6 +2,7 @@
#include "aes.h" #include "aes.h"
#include "base64.h" #include "base64.h"
#include "cJSON.h" #include "cJSON.h"
#include "color.h"
#define TAGLIB_STATIC #define TAGLIB_STATIC
#include "taglib/toolkit/tfile.h" #include "taglib/toolkit/tfile.h"
@@ -358,7 +359,7 @@ NeteaseCrypt::NeteaseCrypt(std::string const &path)
if (n <= 0) if (n <= 0)
{ {
std::cout << "[Warn] " << path << " missing metadata infomation can't fix some infomation!" << std::endl; std::cout << BOLDYELLOW << "[Warn] " << RESET << "'" << path << "' missing metadata infomation can't fix some infomation!" << std::endl;
mMetaData = NULL; mMetaData = NULL;
} }
@@ -391,23 +392,24 @@ NeteaseCrypt::NeteaseCrypt(std::string const &path)
mMetaData = new NeteaseMusicMetadata(cJSON_Parse(modifyDecryptData.c_str())); mMetaData = new NeteaseMusicMetadata(cJSON_Parse(modifyDecryptData.c_str()));
} }
// skip crc32 & unuse charset // skip crc32 & image version
if (!mFile.seekg(9, mFile.cur)) if (!mFile.seekg(5, mFile.cur))
{ {
throw std::invalid_argument("can't seek file"); throw std::invalid_argument("can't seek file");
} }
uint32_t cover_frame_len{0};
read(reinterpret_cast<char *>(&cover_frame_len), 4);
read(reinterpret_cast<char *>(&n), sizeof(n)); read(reinterpret_cast<char *>(&n), sizeof(n));
if (n > 0) if (n > 0)
{ {
char *imageData = (char *)malloc(n); mImageData = std::string(n, '\0');
read(imageData, n); read(&mImageData[0], n);
mImageData = std::string(imageData, n);
} }
else else
{ {
std::cout << "[Warn] " << path << " missing album can't fix album image!" << std::endl; std::cout << BOLDYELLOW << "[Warn] " << RESET << "'" << path << "' missing album can't fix album image!" << std::endl;
} }
mFile.seekg(cover_frame_len - n, mFile.cur);
} }

Binary file not shown.