lofty-rs
lofty-rs copied to clipboard
Add options to suppress errors
Most of the errors out in the wild come from one or two items in an entire tag. Rather than hard error, it'd be nice if there were options to allow for certain (harmless) errors to be discarded.
Some ideas:
- Discard items causing text decoding errors (very common)
- Discard audio property reading errors (return the incomplete properties)
- More?
I'm thinking this could be exposed by Probe and AudioFile, and would look like this:
let parse_options = ParseOptions {
suppress_text_decode_err: true,
suppress_audio_property_err: false,
// ...
};
let file = Probe::open(path)
.options(parse_options)
.guess_file_type()?
.read(true);
// and
let file = Mp3File::read_with_options(reader, true, parse_options)?;
Any thoughts? Would you actually use the feature?
For me both - strict and relaxed would be useful - one to check for bugs in library/provided music files and one for reading as much tags as possible.
This reminds me https://github.com/pdf-rs/pdf/issues/129.
I really like that idea. I think it could be better than having to set a bunch of options.