Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor comment handling into tag map. #4

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

hopesea
Copy link

@hopesea hopesea commented Oct 31, 2021

Process Vorbis comment as a map for cleaner handling of tags. Allow for setting (in addition to previous add) handling of tags. Case-insensitive handling of tag names.

@eternal-flame-AD
Copy link
Member

Hi hopesea,

Thanks for the submission and it really solved a lot of the problems that I know this package had but did not have energy to fix due to my own work schedule.

However I am not in favor of changing this from a slice to a map, there are two drawbacks to this which I don't think making this compromise is worth it for a simple wrapper package on Vorbis tags:

  • Regarding the case insensitive matching, I think it is best not to silently normalize existing non-conforming tag names. When appending to existing tags, respect the casing the caller provided (so if other packages are broken in case matching they can mitigate this issue), instead of normalizing them silently. For standard tag names we already have built-in constants in upper case so they should not be incentivized to use lesser-used lower casing.
  • For simple manipulation of tags, the time complexity benefit of using maps really does not worth the side effect of losing ordering to me. As a wrapper package I would like a parse then marshal routine return byte-identical data instead of reordering them.

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.

2 participants