Ejemplo n.º 1
0
def update_database(vid_fname, thumb_fname, object_id, object_qos):
    """
    Update the client group's database.
    """
    conn = db.connect()
    vfurl = settings.ARCHIVE_FEED_URLS + vid_fname
    ssfurl = 'NULL'
    if thumb_fname is not None:
        ssfurl = settings.ARCHIVE_FEED_URLS + thumb_fname
    db.addArchiveFootage(conn, vfurl, object_id, object_qos, ssfurl)
    db.close(conn)
Ejemplo n.º 2
0
 def updateInital(self,conn):
     """
     -update the SQL database, with the current information
     -using there stored procedure
     """
     self.get_ArchiveFeeds()
     try:
         db.deleteTable(conn,'archives')
         for x in range(len(self.filenames)):
             # Archive is not there need to update database
             db.addArchiveFootage(conn,settings.ARCHIVE_FEED_URLS+self.filenames[x],
                                 self.objects[x],self.qos[x],
                                 settings.ARCHIVE_FEED_URLS+self.thumb[x]+'.jpg')
         log('Updated the Client database with Archived Videos')
     except MySQLdb.Error as e:
         log("Error %d: %s" % (e.args[0], e.args[1]))