media-db
v0.1.5
Published
using for pull media data from other server
Downloads
2
Maintainers
Readme
media-db
using for pull media datbase to other database
requirements
- movie client api yts-client
- movie client api tmdb-client
- database mongoose
- some storage space
installation
# use node package manager
npm install media-db
usage
import module
var MediaDb = require('media-db');
create an instance of media db
var options = {
source: <string>, // yts, tmdb
dest: <string> // mongodb://<address>/<db-name>
};
var mediaDb = new MediaDb(options);
pull data base with size
// make options
var opts = {
size: <number> // total item to pull
};
// using for handler when meida db send state
// params
// - err: error occur during pull
// - state: object contains value show pull state
// - done: number of item was pull completed
// - total: total item to pull
function handler(err, state) { }
// pull
mediaDb.pull(opts, handler);
pull all database
// handler same as pull data with size
function handler(err, state) {}
// pull
mediaDb.pullAll(handler);
development
# clone form revision system control
# require ssh-key, please contact with owner to get one
git clone [email protected]:thelordofthetimes/media-db.git
cd media-db
# install dependency module
npm install
# run test
npm test
# write code and more..
# update revision system control
git add .
git commit -am '<message>'
git push