Skip to content

Conversation

@Serial-ATA
Copy link
Owner

@Serial-ATA Serial-ATA commented Jun 3, 2023

The new BestAttempt variant will be less eager to error than the previous default, ParsingMode::Strict. This comes with the consequence that the input may not be entirely spec-compliant.

This implements BestAttempt for UniqueFileIdentifierFrame::parse and adds Strict checks for VorbisComments parsing. More checks will come in the future.

closes #204

The new `BestAttempt` variant will be less eager to error than the previous default, `ParsingMode::Strict`. This comes with the consequence that the input may not be *entirely* correct.
///
/// This mode will attempt to fill in any holes where possible in otherwise valid, spec-compliant input.
///
/// NOTE: A readable input does *not* necessarily make it writeable.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concise disclaimer 👍 That's exactly what clients need to be prepared for.

This introduces 3 new possibilities:

* Failure in `Strict` when encountering a mixed-encoding vendor string (previously continued)
* Ignoring failed picture reading in `Relaxed` (previously errored)
* Failure in `Strict` when an invalid key is encountered (previously skipped)
A UFID frame without an owner is invalid, and will fail in `ParsingMode::Strict`. In `ParsingMode::BestAttempt`, however, we will just replace it with an empty string.
@Serial-ATA Serial-ATA marked this pull request as ready for review June 3, 2023 16:41
@Serial-ATA Serial-ATA merged commit 6e555d1 into main Jun 3, 2023
@Serial-ATA Serial-ATA deleted the parse-mode-overhaul branch June 3, 2023 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ID3v2: Missing owner in UFID frame

3 participants