Permalink
Browse files

Added functionality to use spcsser/ueberDB findKey functionality.

  • Loading branch information...
1 parent 7a49c82 commit c9f137b2e581339b46522bf6ce70ce9b0eb5612d @spcsser committed Jan 9, 2013
Showing with 3 additions and 7 deletions.
  1. +3 −7 src/node/db/PadManager.js
View
@@ -46,12 +46,12 @@ var padList = {
list: [],
init: function()
{
- db.get("pads", function(err, dbData)
+ db.findKeys("pad:*", "*:*:*", function(err, dbData)
{
if(ERR(err)) return;
if(dbData != null){
dbData.forEach(function(val){
- padList.addPad(val,false);
+ padList.addPad(val.replace(/pad:/,""),false);
});
}
});
@@ -60,21 +60,17 @@ var padList = {
getPads: function(){
return this.list;
},
- addPad: function(name,immediateSave)
+ addPad: function(name)
{
if(this.list.indexOf(name) == -1){
this.list.push(name);
- if(immediateSave == undefined || immediateSave == true){
- db.set("pads", this.list);
- }
}
},
removePad: function(name)
{
var index=this.list.indexOf(name);
if(index>-1){
this.list.splice(index,1);
- db.set("pads", this.list);
}
}
};

0 comments on commit c9f137b

Please sign in to comment.