Commit Graph

23 Commits

Author SHA1 Message Date
solitudechn
20b746bee5 fix(ncm): Handle mixed-type artist field in metadata parsing
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.
2025-08-09 23:58:03 +00:00
鲁树人
f753b9c67d fix #78 #106: app crash due to imcompatible ncm metadata json 2024-11-02 13:44:29 +09:00
鲁树人
c87204c78a fix #96: ncm file parsing when image cover 2 is not empty 2024-09-12 15:08:04 +01:00
NestorRay
9ddbd5f702 DELETE not necessary MusicID,AlbumID etc. 2024-01-28 16:24:58 +08:00
NestorRay
d480c9a2f8 CHANGE metadata INT into interface{} 2024-01-28 13:06:30 +08:00
鲁树人
4ad9a721f0 fix: dynamic music id type 2024-01-28 03:59:17 +00:00
Unlock Music Dev
138adbf846 feat(ncm): support audio meta getter 2022-12-06 21:52:16 +08:00
Unlock Music Dev
ea3236e14b refactor: change decoder init parameter 2022-12-04 23:05:38 +08:00
Unlock Music Dev
6c168ee536 refactor: move audio sniffer to internal package 2022-11-22 06:16:40 +08:00
Unlock Music Dev
f6748d644d refactor: code cleaning 2022-11-20 02:47:28 +08:00
Unlock Music Dev
14c9d49d46 refactor: change module path 2022-11-19 07:44:44 +08:00
Unlock Music Dev
67ff0c44cd refactor: use io.Reader instead of custom method 2022-11-19 07:25:43 +08:00
Unlock Music Dev
e2fc56ddb2 refactor: remove logging in algorithms 2022-11-19 07:25:40 +08:00
Emmm Monster
3f3980de38 fix #18: skip noop decoder 2021-11-11 23:43:20 +08:00
Emmm Monster
c836ac7cb5 Clean TODOs 2021-05-23 19:58:23 +08:00
Emmm Monster
f9686bbfc4 Decoder.GetAudioExt() return extension with . 2021-05-16 12:15:22 +08:00
Emmm Monster
9caf11217b Remove Debug Deps 2021-03-02 18:19:24 +08:00
Emmm Monster
939cfd38d0 Fix incorrect package path 2021-03-02 18:16:19 +08:00
Emmm Monster
91e23a20dd Register Decoder With Default Output Ext 2020-12-26 16:07:48 +08:00
Emmm Monster
d5031e1935 Add Decoder Registry
Add Raw Decoder
2020-12-26 15:47:10 +08:00
Emmm Monster
a92ea82090 Update NCM, QMC Decoder 2020-12-26 03:21:07 +08:00
Emmm Monster
db85f60023 Update NCM Decoder 2020-12-26 03:20:52 +08:00
Emmm Monster
98a645a45c Add NCM Decoder 2020-12-26 03:20:46 +08:00