From 21dcce22966640e4b72575a6458622a4079ee924 Mon Sep 17 00:00:00 2001 From: John McLear Date: Tue, 4 Sep 2012 17:25:19 +0200 Subject: [PATCH] Update src/node/db/AuthorManager.js --- src/node/db/AuthorManager.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/node/db/AuthorManager.js b/src/node/db/AuthorManager.js index 06b69051..6fe38abe 100644 --- a/src/node/db/AuthorManager.js +++ b/src/node/db/AuthorManager.js @@ -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