public void Update(DownloadDBModel dbm)
 {
     lock (db_lock)
     {
         var db = new SQLiteConnection(db_path);
         db.Update(dbm);
         db.Close();
     }
 }
 public void Add(DownloadDBModel dbm)
 {
     lock (db_lock)
     {
         var db    = new SQLiteConnection(db_path);
         var count = db.ExecuteScalar <int>("select count(*) from DownloadDBModel");
         dbm.Id = count;
         db.Insert(dbm);
         db.Close();
     }
 }