nikhilm / node-taglib

Simple taglib bindings to Javascript using node.js
http://nikhilm.github.com/node-taglib
MIT License
147 stars 25 forks source link

Simplify API and fix a few issues #41

Open nikhilm opened 11 years ago

nikhilm commented 11 years ago

I've pushed a new README.md to branch 'memtag', which describes how the new API would be.

The Metadata object is actually a standard JS object with none of the accessor code that is currently in use for the Tag object. It has write() and writeSync() methods which will handle copying back values from v8 to taglib.

This simplifies the API drastically - no read() vs. tag(), no 'audio-properties are second class'. There is also a big reduction in the number of lines of code under the hood.

The changes will also fix parts of #38 which is that FileRefs will be closed as soon as data has been read, and then save() will reopen a fileref.

35 will also be fixed with readSync() providing access to audio properties as well.

I have some WIP patches that make all these changes. @lennart @masterkain I would appreciate your thoughts on this. Thanks!

masterkain commented 11 years ago

Sounds good to me, we haven't completed the switch to node 0.10 yet but it's in the pipeline and we can help testing.

Thanks :+1:

lennart commented 11 years ago

I really appreciate the more consistent proposed API, haven't been upgrading to 0.10 either though.

I would love to see the changes for FileRef handling, as the windows port of a project is stuck since repeated calls to the same file fail with the current version.

nikhilm commented 11 years ago

I've pushed the patches as one big commit (sorry).

AFAIK there are no hard dependencies on node v0.10, likely only minor compile and typedef errors. I don't have a ready build on 0.8 right now and I'm really tired, but if someone could comment with any errors, that'd be great!

@lennart could you check the fileref handling issue on windows? On Linux, if I try to read a large number of files, I still get some errors, possibly because I'm leaking something or maybe v8/libuv aren't playing well together at getting rid of FileRef's faster. I need to investigate this.