Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid reading when record date is presented #452

Closed
tramhao opened this issue Sep 4, 2024 · 6 comments · Fixed by #453
Closed

Invalid reading when record date is presented #452

tramhao opened this issue Sep 4, 2024 · 6 comments · Fixed by #453
Labels
bug Something isn't working
Milestone

Comments

@tramhao
Copy link

tramhao commented Sep 4, 2024

Reproducer

Firstly I would like to thank for this great project. Before lofty, I use several different packages to read tags from different formats.
I recently met a problem though.

My code to read tags is:
https://github.com/tramhao/termusic/blob/master/lib/src/track.rs

Don't know when this problem happens, but now more than half of my mp3 are not recognized. I read the same file with tageditor and it's all right. The tags are in ID3V2 format. The only difference is, the unsupported file all have record date presented. When I delete this tag in tageditor, save it, it becomes supported all right by lofty. Is it a known bug or my code is wrong? I didn't use this tag in my code actually.

Summary

Passing of ID3V2 with record date tag is not working.

Expected behavior

It should be able to read all tags.

Assets

I cannot upload mp3 files but you can check this with any mp3 files in termusic. Thanks.

@tramhao tramhao added the bug Something isn't working label Sep 4, 2024
@tramhao
Copy link
Author

tramhao commented Sep 4, 2024

Seem a little bit update:
When record date is 4 number it is all right to read by lofty, when record date is 8 digits lofty cannot read it. Wired.

@Serial-ATA
Copy link
Owner

Hello!

The thing with Lofty is, it will parse timestamps into a Timestamp. This is different from other libraries, which will just return a string.

Timestamp parsing is already setup to handle multiple common encoding errors, but it could be that your file has one I am not aware of. Could you open the file up in a tag editor and send the recording date field here? Or you can email me the asset at serial AT [domain on my profile].

When record date is 4 number it is all right to read by lofty, when record date is 8 digits lofty cannot read it. Wired.

A 4 digit timestamp in ISO 8601 format is just a year, which is perfectly valid (it is the only required field).

@tramhao
Copy link
Author

tramhao commented Sep 5, 2024

The wrong recording date in tageditor is like this:

20200820

The correctly parsed recording date in tageditor is like this:

2009

Or empty is all right. I sent to you a wrongly parsed mp3 by email.

@tramhao
Copy link
Author

tramhao commented Sep 5, 2024

By the way, most of my tags were embeded by yt-dlp(ffmpeg underlying). The recording date should be from youtube.

@Serial-ATA
Copy link
Owner

Yeah, looks like yt-dlp embeds dates incorrectly for some reason. Your date "20200820" should be "2020-08-20". I'll see if I can easily support that format since yt-dlp audio files are pretty popular.

@tramhao
Copy link
Author

tramhao commented Sep 10, 2024

I confirm that the problem is solved by #453. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants