1
8
Fork
You've already forked nup
0

Print useful errors for ID3v2.2 tags #136

Closed
opened 2026年02月12日 20:00:25 +01:00 by derat · 0 comments
Owner
Copy link

nup debug (and presumably other subcommands) prints an unhelpful error when it's unable to read a file due to it having an ID3v2.2 tag:

% nup debug -id3 bad.mp3
Failed reading ID3 tag: no ID3 tag
% nup debug -mpeg bad.mp3
Failed reading MPEG frames: computing duration: unsupported layer

The old github.com/hjfreyer/taglib-go package that I'm using only supports ID3v2.3 and ID3v2.4; v2.2 is an obsolete version that uses 3-character frame IDs (e.g. TT2) instead of 4-character ones (TIT2).

I don't think it's worthwhile supporting v2.2 tags (it's easy to convert them to v2.3 or v2.4 using a program like eyeD3), but I should at least detect them so the code doesn't get confused later when it's trying to read MPEG frames. taglib-go doesn't return a standard error for this, so I should probably just do a string comparison.

`nup debug` (and presumably other subcommands) prints an unhelpful error when it's unable to read a file due to it having an ID3v2.2 tag: ``` % nup debug -id3 bad.mp3 Failed reading ID3 tag: no ID3 tag % nup debug -mpeg bad.mp3 Failed reading MPEG frames: computing duration: unsupported layer ``` The old [github.com/hjfreyer/taglib-go](https://pkg.go.dev/github.com/hjfreyer/taglib-go) package that I'm using only supports ID3v2.3 and ID3v2.4; v2.2 is an obsolete version that uses 3-character frame IDs (e.g. `TT2`) instead of 4-character ones (`TIT2`). I don't think it's worthwhile supporting v2.2 tags (it's easy to convert them to v2.3 or v2.4 using a program like `eyeD3`), but I should at least detect them so the code doesn't get confused later when it's trying to read MPEG frames. [taglib-go doesn't return a standard error for this](https://github.com/hjfreyer/taglib-go/blob/cb3b18d1ad7b/taglib/taglib.go#L65), so I should probably just do a string comparison.
Sign in to join this conversation.
No Branch/Tag specified
main
headless
picture
datastore
No results found.
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
derat/nup#136
Reference in a new issue
derat/nup
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?