Update src/node/db/AuthorManager.js

This commit is contained in:
John McLear 2012-09-04 17:25:19 +02:00
parent 40a7b43799
commit 21dcce2296

View file

@ -141,6 +141,25 @@ exports.getAuthor = function (author, callback)
db.get("globalAuthor:" + author, callback);
}
/**
* Returns the Author Name of the author
* @param {String} author The id of the author
* @param {Function} callback callback(err, name)
*/
exports.getAuthorName = function (authorID, callback)
{
db.getSub("globalAuthor:" + author, ["name"], callback);
console.log(authorID);
db.getSub("globalAuthor:" + authorID, ["name"], function(err, authorName){
if(ERR(err, callback)) return;
console.log(authorName);
callback(null, {authorName: authorName});
});
}
/**
* Returns the color Id of the author
* @param {String} author The id of the author