mirror of
https://git.unlock-music.dev/um/cli.git
synced 2025-08-13 14:43:16 +08:00

The current implementation for parsing artist metadata in `ncmMetaMusic.GetArtists` does not handle cases where the "artist" JSON field is a list containing mixed-type inner lists. For certain NCM files (often those with FLAC format), the artist data is structured as `[["Artist Name", 12345]]`. The existing type assertion for `[][]string` fails for this structure because the inner slice is of type `[]interface{}`, not `[]string`. This results in the artist metadata being dropped during the conversion process. This commit enhances the `GetArtists` method by adding a new case to the `type switch` to specifically handle the `[]interface{}` type. The new logic iterates through the nested structure and correctly extracts the artist name, which is assumed to be the first string element in each inner slice. This fix improves compatibility with a wider range of NCM files and ensures artist metadata is reliably parsed, preventing data loss for affected files.
Unlock Music Project - CLI Edition
Original: Web Edition https://git.unlock-music.dev/um/web
Warning
在本站 fork 不会起到备份的作用,只会浪费服务器储存空间。如无必要请勿 fork 该仓库。
Features
- All Algorithm Supported By
unlock-music/web
- Complete Metadata & Cover Image
Release
Install from source
- Requirements: Golang 1.23.3
- run
go install unlock-music.dev/cli/cmd/um@master
Build from repo source
- Pull repo source.
- Build with
go build ./cmd/um
.
It will produce um
or um.exe
(Windows).
How to use
- Drag the encrypted file to
um.exe
(Tested on Windows) - Run:
./um [-o <output dir>] [-i] <input dir/file>
- Use
./um -h
to show help menu
Languages
Go
99.4%
Shell
0.6%