Skip to content

Refactor comment handling into tag map.#4

Open
hopesea wants to merge 7 commits intogo-flac:masterfrom
hopesea:master
Open

Refactor comment handling into tag map.#4
hopesea wants to merge 7 commits intogo-flac:masterfrom
hopesea:master

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