- std::string ak=GetAttribute("ADD_KEY","IGNORED_FILES","ID",id);
- //Sets the new add key attribute for the file
- SetAttribute("ADD_KEY","IGNORED_FILES",addKey,"ID", id);
- //Sets the new remove attribute for the file
- SetAttribute("REMOVE","IGNORED_FILES",remove,"ID", id);
- //Sets the new time attribute for the file
- SetAttribute("TIME","IGNORED_FILES",time,"ID", id);
+ std::string ak=GetAttribute("ADD_KEY","IGNORED_FILES","ID",id,refdb);
+ //gets the parent database to check if the file has been added to the current database
+ std::string parentDB=GetAttribute("*","ADD_OPS","ADD_KEY",ak,refdb);
+ //If there is no such entry, add it
+ if(parentDB.compare("")==0)
+ {
+ std::string insert;
+ insert="INSERT INTO IGNORED_FILES (ADD_KEY,PATH,REMOVE,TIME) VALUES('";
+ insert+=addKey+"','";
+ insert+=pat+"','";
+ insert+=remove+"',";
+ insert+=time+");";
+ UPDATESYNCDB(insert);
+ }
+ else
+ {
+ //Sets the new add key attribute for the file
+ SetAttribute("ADD_KEY","IGNORED_FILES",addKey,"ID", id,refdb);
+ //Sets the new remove attribute for the file
+ SetAttribute("REMOVE","IGNORED_FILES",remove,"ID", id,refdb);
+ //Sets the new time attribute for the file
+ SetAttribute("TIME","IGNORED_FILES",time,"ID", id,refdb);
+ }