Closed digimezzo closed 1 year ago
Thank you so much for putting the effort add support for MP4 files! I'm beyond thrilled that someone was interested in contributing to little side project of mine. Full disclosure, I may not have the struck the right balance of pedantic vs important in these comments. Code reviews in a professional scenario, like I do day-to-day, probably need a different level of scrutiny than a volunteer pull request. As such, feel free to address or ignore any of these comments - the tests verify it works, and that's the most important part. I'll likely tweak some of it as well before it gets released (please don't take that personally!) Like I said, I am incredibly grateful you wanted to contribute back!
You're very welcome. I'm using your library in one of my projects and I needed m4a support. So I decided to try porting it. Thank you for the thorough review. Don't worry about the pedantic vs important ratio. I spend time at both sides of pull requests (development and review) in a professional scenario on a daily basis. And I much prefer very thorough reviews of my code. I'll go through your comments and will address them in the next days. Don't worry if I go silent for a few days next week. I'll take a short vacation away from computers. But I'll definitely address all your comments.
@benrr101 I'm done with handling your comments. I've left the comments for which I require further help as unresolved.
@digimezzo Looks really good! Thanks for addressing the pending comments! Let me know your thoughts on the getChildrenOfType stuff and it should be ready to check in.
Once again, thank you so much for helping with this! I'll get started on a new release with this feature added in a day or two 🚀
Once again, thank you so much for helping with this! I'll get started on a new release with this feature added in a day or two rocket
You're welcome. Thanks for the merge!
Hey @benrr101 did you get a release out with this in the end? I didn't see it!
@ion-dev Not yet ... 😬 It's my project for the long weekend.
Thanks @benrr101 you da man! Really looking forward to testing it out 🤟🏻
@ion-dev Sorry this has taken so long ... I kinda went overboard with improving the code a bit and adding tests. The good news is I found some bugs in the code and fixed them (even found a bug in the C# implementation). The bad news is ... I'm still not done with it. The tests are still in progress, and once those are done I have a couple more tweaks to make. I'm gonna push to get these done asap.
@benrr101 No apologies needed! I'm just happy that you're still on it and can't wait to test it out 💪
@ion-dev This feature has finally been released 🎉
@benrr101 I gave up on this previously because it actually wasn't working as expected and I didn't have time to continue, but I'm having another look now and I think maybe you can help.
It seems that when using save() and nothing has changed, the MP4 container is removed leaving no metadata. If I make several changes and save, it seems to be ok. But if I just save again without changes, everything disappears.
I'm using Kid3 to inspect the metadata FYI.
Related File: ~/mpeg4/mpeg4File.js (suspected issue in save() method, line 54).
Any idea how or why that might be happening?
@benrr101 just to follow up on this, it appears that the metadata does actually exist (I was able to read it using "music-metadata") but it's invisible to Kid3 and the file system (mac).
So where is the data stored and how can we fix this?
@benrr101 - I've fixed it!
udtaHeader.totalBoxSize was already updated to tagData.length.
The solution was to calculate this before Mpeg4BoxRenderer.renderBox(udtaBox); Maybe you can check and add these changes?
Pull request ready! https://github.com/benrr101/node-taglib-sharp/pull/108
This pull request adds mpeg4 support and fixes #67. It is a complete translation of the C# TagLib# implementation.
Note: due to the inheritance structure of the mpeg4 boxes in the C# implementation, I was forced to put all box classes into a single file mpeg4boxes.ts. The boxes depend on each other in a circular way (e.g.: Mpeg4Box imports IsoHandlerBox while IsoHandlerBox extends Mpeg4Box and thus imports Mpeg4Box), which causes the error "Cannot access Mpeg4Box before initialization" in runtime if the boxes are each placed in their own file. I've put this info as a class comment in file mpeg4boxes.ts.