polyfloyd / rust-id3

A rust library for reading and writing ID3 metadata

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Return partial tag information after decoding errors

agersant opened this issue · comments

Hello!

I use rust-id3 for https://github.com/agersant/polaris and it is very valuable to me. Thank you for writing it. A situation that has happened a few times is that users notice some of their files are not displaying any metadata in Polaris, even though they work in other media players.

The root cause is that their files have invalid tags (due to subtle encoding errors, usually about unsynchronization or synchsafe integers). When this happens, rust-id3 returns an error and no information is available - even though many valid frames may have been decoded before running into the error.

Would it be possible to expose whatever was decoded in the output of rust-id3 (either within the error or as a separate API call altogether)?

Many thanks!

Hey agersant,

This seems like a reasonable feature to implement. It is also possible to add it without breaking too much compatibility by adding the partial tag as an Option<Tag> to the error struct.

I'll have a deeper look at it later this week. :)

Thank you!

Hey @agersant,

I have pushed a patch to branch error-partial-tag. Could you check whether it addresses your problem?

If at all possible, I would also be interested in receiving the problematic files to ensure it is not a fixable issue with the decoder. Otherwise, we can just stick with the currently chosen approach. :)

Thank you, I was able to confirm that this works as expected!
The files which prompted this request are here.

I already did the deep dive into figuring out why the decoding errors happened, you can read the findings in this thread: agersant/polaris#59 (comment)

Hey @agersant,

Glad to hear it solves your problem! :) I have pushed version 0.4.0 with the update along with some other stuff that was fixed since the last release.

From the thread you linked it seems that the encoding errors are caused by invalid input rather than a decoder bug. This library could have support for such files but I do not consider it a priority.

Thanks!