Skip to content

Invalid reading when record date is presented #452

Closed

Description

@tramhao

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.

Activity

  1. added
    bug
    on Sep 4, 2024
  2. tramhao commented on Sep 4, 2024

    @tramhao
    Author

    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.

  3. Serial-ATA commented on Sep 4, 2024

    @Serial-ATA
    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).

  4. tramhao commented on Sep 5, 2024

    @tramhao
    Author

    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.

  5. tramhao commented on Sep 5, 2024

    @tramhao
    Author

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

  6. Serial-ATA commented on Sep 5, 2024

    @Serial-ATA
    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.

  7. tramhao commented on Sep 10, 2024

    @tramhao
    Author

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

  8. added this to the 0.22.0 milestone on Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions