fix: prevent duplicated flac metadata #1

Merged
taurusxin merged 1 commits from d0ngd1gua/ncmdump-go:main into main 2025-01-27 15:12:19 +08:00
Contributor

仅 flac 部分有问题,mp3 没必要加判断语句

flac

before:

METADATA block #2
  type: 4 (VORBIS_COMMENT)
  is last: false
  length: 155
  vendor string: reference libFLAC 1.3.2 20170101
  comments: 7
    comment[0]: ALBUM=Axolotl
    comment[1]: ARTIST=C418
    comment[2]: TITLE=Axolotl
    comment[3]: TRACKNUMBER=1
    comment[4]: TITLE=Axolotl
    comment[5]: ARTIST=C418
    comment[6]: ALBUM=Axolotl

图片
after:

METADATA block #2
  type: 4 (VORBIS_COMMENT)
  is last: false
  length: 106
  vendor string: reference libFLAC 1.3.2 20170101
  comments: 4
    comment[0]: ALBUM=Axolotl
    comment[1]: ARTIST=C418
    comment[2]: TITLE=Axolotl
    comment[3]: TRACKNUMBER=1

图片

mp3

经检验,元数据并未重复

00000000: 4944 3303 0000 0010 2642 5450 4531 0000  ID3.....&BTPE1..
00000010: 0010 0000 0347 656f 7267 6520 5769 6e73  .....George Wins
00000020: 746f 6e00 5450 4f53 0000 0008 0000 01fe  ton.TPOS........
00000030: ff00 3100 0000 5452 434b 0000 0008 0000  ..1...TRCK......
00000040: 01fe ff00 3600 0000 5453 5345 0000 000e  ....6...TSSE....
00000050: 0000 004c 6176 6635 362e 342e 3130 3100  ...Lavf56.4.101.
00000060: 5441 4c42 0000 0014 0000 0357 696e 7465  TALB.......Winte
00000070: 7220 496e 746f 2053 7072 696e 6700 5449  r Into Spring.TI
00000080: 5432 0000 0022 0000 0342 6c6f 7373 6f6d  T2..."...Blossom
00000090: 202f 204d 6561 646f 773a 2042 6c6f 7373   / Meadow: Bloss
000000a0: 6f6d 2f4d 6561 646f 7700 4150 4943 0004  om/Meadow.APIC..
000000b0: 1298 0000 0369 6d61 6765 2f6a 7065 6700  .....image/jpeg.
000000c0: 0300 ffd8 ffe0 0010 4a46 4946 0001 0101  ........JFIF....
000000d0: 0048 0048 0000 ffdb 0043 0002 0101 0101  .H.H.....C......
000000e0: 0102 0101 0102 0202 0202 0403 0202 0202  ................
000000f0: 0504 0403 0406 0506 0606 0506 0606 0709  ................
仅 flac 部分有问题,mp3 没必要加判断语句 ### flac before: ``` METADATA block #2 type: 4 (VORBIS_COMMENT) is last: false length: 155 vendor string: reference libFLAC 1.3.2 20170101 comments: 7 comment[0]: ALBUM=Axolotl comment[1]: ARTIST=C418 comment[2]: TITLE=Axolotl comment[3]: TRACKNUMBER=1 comment[4]: TITLE=Axolotl comment[5]: ARTIST=C418 comment[6]: ALBUM=Axolotl ``` ![图片](/attachments/941d4428-b6bb-420d-985f-f2d6a3de0a31) after: ``` METADATA block #2 type: 4 (VORBIS_COMMENT) is last: false length: 106 vendor string: reference libFLAC 1.3.2 20170101 comments: 4 comment[0]: ALBUM=Axolotl comment[1]: ARTIST=C418 comment[2]: TITLE=Axolotl comment[3]: TRACKNUMBER=1 ``` ![图片](/attachments/9eca3ecb-aa5a-45f2-97cb-ea1585afdc8f) ### mp3 经检验,元数据并未重复 ``` 00000000: 4944 3303 0000 0010 2642 5450 4531 0000 ID3.....&BTPE1.. 00000010: 0010 0000 0347 656f 7267 6520 5769 6e73 .....George Wins 00000020: 746f 6e00 5450 4f53 0000 0008 0000 01fe ton.TPOS........ 00000030: ff00 3100 0000 5452 434b 0000 0008 0000 ..1...TRCK...... 00000040: 01fe ff00 3600 0000 5453 5345 0000 000e ....6...TSSE.... 00000050: 0000 004c 6176 6635 362e 342e 3130 3100 ...Lavf56.4.101. 00000060: 5441 4c42 0000 0014 0000 0357 696e 7465 TALB.......Winte 00000070: 7220 496e 746f 2053 7072 696e 6700 5449 r Into Spring.TI 00000080: 5432 0000 0022 0000 0342 6c6f 7373 6f6d T2..."...Blossom 00000090: 202f 204d 6561 646f 773a 2042 6c6f 7373 / Meadow: Bloss 000000a0: 6f6d 2f4d 6561 646f 7700 4150 4943 0004 om/Meadow.APIC.. 000000b0: 1298 0000 0369 6d61 6765 2f6a 7065 6700 .....image/jpeg. 000000c0: 0300 ffd8 ffe0 0010 4a46 4946 0001 0101 ........JFIF.... 000000d0: 0048 0048 0000 ffdb 0043 0002 0101 0101 .H.H.....C...... 000000e0: 0102 0101 0102 0202 0202 0403 0202 0202 ................ 000000f0: 0504 0403 0406 0506 0606 0506 0606 0709 ................ ```
d0ngd1gua added 1 commit 2025-01-27 15:03:27 +08:00
taurusxin merged commit 3a48a5d667 into main 2025-01-27 15:12:19 +08:00
Owner

感谢,马上发 Release

感谢,马上发 Release
Owner

有问题...需要修

有问题...需要修
Sign in to join this conversation.
No Reviewers
No Label
No Milestone
No project
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: taurusxin/ncmdump-go#1
No description provided.