lib/index.js
/**
 * Creates and returns a metadata document and an inlined
 * file attachment document for a given track.
 *
 * @param {object} metadata
 * @param {buffer} buffer
 */
Creates and returns a metadata document and an inlined
file attachment document for a given track.

@param {object} metadata
@param {buffer} buffer
Creates and returns a metadata document and an inlined file attachment document for a given track . @param { object } metadata @param { buffer } buffer
function makeDocs (metadata, buffer) {
  var docs = [];
  metadata._id = 'm:' + metadata._id;
  docs.push(metadata);
  docs.push({
    _id: metadata['musicbrainz_trackid'],
    _attachments: {
      'file.mp3': {
        'content_type': 'audio/mpeg',
        'data': buffer.toString('base64')
      }
    }
  });
  return docs;
}
function makeDocs ( metadata , buffer ) { var docs = [ ] ; metadata . _id = 'm:' + metadata . _id ; docs . push ( metadata ) ; docs . push ( { _id : metadata [ 'musicbrainz_trackid' ] , _attachments : { 'file.mp3' : { 'content_type' : 'audio/mpeg' , 'data' : buffer . toString ( 'base64' ) } } } ) ; return docs ; }
Creates and returns a metadata document and an inlined
 file attachment document for a given track.
Creates and returns a metadata document and an inlined file attachment document for a given track .