dhowden / tag

ID3, MP4 and OGG/FLAC metadata parsing in Go
BSD 2-Clause "Simplified" License
558 stars 72 forks source link

add: fn{parse, acceptedFileTypes}; #99

Open kendfss opened 1 year ago

bertvandepoel commented 1 year ago

Would you consider maybe adding a clearer title and a little description of what this PR does and what its aim is. Commit messages in this project aim at explaining what the change does, not how the code has changed. This hardly gives an idea what feature you add or what problem you solve except if people go look at the code.

Thank you!

kendfss commented 1 year ago

Sorry. The Parse function takes a file path and produces a metadata for readonly use-case

the AcceptedFileTypes function allows users to iterate over accepted file types, say when creating a tree-walking file organizer, to avoid trying to check any files that may not match. Could use magic numbers for that, but not sure the time tradeoff is worthwile for my use case.

Ultimately, just sharing them because I wanted to keep using them without continuing to use a fork, but if you don't want them that's fair too.

edit Could also give the file extention constants a next and/or prev method. Less immediately compatible with the libraries I use, but at least allows you to catch bad input at runtime. That is, it is more likely to eventually remind devs to remember to update the iterator after augmenting the api.

bertvandepoel commented 1 year ago

Thanks for adding some more info. I'm actually not the developer of this library and not even that good at Go. I'm following this repo however since I'm quite invested in its maintenance and I hope someone will at some point contribute writing functionality to it! I expect that @dhowden will respond to your PR in due time :)

wader commented 1 year ago

@bertvandepoel what kind of functionality are you looking for? can maybe help if not too big

bertvandepoel commented 1 year ago

@bertvandepoel what kind of functionality are you looking for? can maybe help if not too big

I'm afraid I'm hoping for #15 (aka #71). So not really a small thing to achieve I'm afraid. But let's discuss that inside those issues and not derail this PR :)