Browse Source

gen video queue

ming 3 years ago
parent
commit
6c33a5898b
1 changed files with 2 additions and 1 deletions
  1. 2 1
      api/main.py

+ 2 - 1
api/main.py

@@ -237,7 +237,7 @@ def gen_video_queue(name_hash,name,text_content, image_urls,avatar):
     db['video_queue'].insert({'name_hash':name_hash,'name':name,'text_content':txt_content_seperate_by_dot,'image_urls':img_urls_seperate_by_dot,'avatar':avatar,'timestamp':time_stamp})
     while True:
         if first(db.query('SELECT * FROM video_queue_status'))['status'] == 1:#only one row in this table, which is the id 1 one
-            print('another process running, leave loop')
+            print('another process running, leave loop')#1 means already running
             break
         if first(db.query('SELECT COUNT(1) FROM video_queue'))['COUNT(1)'] == 0:
             print('all finish, leave loop')
@@ -257,6 +257,7 @@ def gen_video_queue(name_hash,name,text_content, image_urls,avatar):
         db['video_queue'].delete(id=top1['id'])
         db.query('UPDATE video_queue_status SET status = 0')
 
+
 def gen_video_queue_eng(name_hash,name,text_content, image_urls,sub_titles,avatar):
     db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/AI_anchor?charset=utf8mb4')
     time_stamp = datetime.fromtimestamp(time.time()).strftime("%Y-%m-%d %H:%M:%S")