-
Hi, I'm trying to read the metadata from a music library with all sorts of file types, I find all working pretty well out of the box. I encountered this error
The part which is failing me:
When browsing the documentation, I found a piece about registering a custom resolver, but don't really know how to go about it in this case, as I dont have a custom type at hand. At this point I dont really know what to try next, as I feel like it's a really bad idea to create the Any hints or things to try? PS: I saw a call for more documentation, I'm happy to create digest of whatever comes out of this for future reference. |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments
-
Hello! That error comes from your file having an incomplete UFID frame, which according to the spec should have an owner identifier. Looking at Symphonia, it looks like the UFID frame is ignored entirely: https://github.com/pdeljanov/Symphonia/blob/c6a14a0405281af555edca98fa56f3c51a46d459/symphonia-metadata/src/id3v2/frames.rs#L338. Since Lofty is purely a metadata crate, it tries to stick a lot closer to the spec. Is this a common issue in your library? It may be worth it to add an exception for this with |
Beta Was this translation helpful? Give feedback.
-
Thanks for the blazing quick response! I wasn't aware of the spec, thanks for the ref. Metadata is such a complex beast! The library is composed of all filetypes of different origins, but I couldn't reproduce exactly this error with no other file I have. While looking at the docs for Thanks 🙏 |
Beta Was this translation helpful? Give feedback.
-
Yeah, that's definitely a weak spot in the docs. :) You use it in Like this: use lofty::{Probe, ParseOptions, ParsingMode};
let options = ParseOptions::new().parsing_mode(ParsingMode::Relaxed);
let tagged_file = Probe::open(path)?.options(options).read()?; For now |
Beta Was this translation helpful? Give feedback.
-
I added
I know too little about the inner workings of The reading of the probe to not panic when a key, which is required by the spec but just isn't there, would be a nice addition when working with organically grown libraries of questionable origin 😆 Thanks a lot for the help. |
Beta Was this translation helpful? Give feedback.
-
Yeah, no one really knows unless they read the code. I really need to get to giving Lofty is a lot stricter than other tag reading libraries by default. I'll see about expanding For now, you should either fix or remove the UFID frame in a tag editor. |
Beta Was this translation helpful? Give feedback.
-
https://en.wikipedia.org/wiki/Robustness_principle Probably we need 3 modes of operation:
|
Beta Was this translation helpful? Give feedback.
-
In 0.14.0 the default parsing mode will be the new |
Beta Was this translation helpful? Give feedback.
https://en.wikipedia.org/wiki/Robustness_principle
Probably we need 3 modes of operation: