|
@@ -1010,10 +1010,15 @@ def gen_video_queue(name_hash,name,text_content, image_urls,avatar,multiLang,vid
|
|
|
shutil.copy(tmp_video_dir+top1['name_hash']+'.mp4',video_dest+top1['name_hash']+'.mp4')
|
|
|
os.remove(tmp_video_dir+top1['name_hash']+'.mp4')
|
|
|
vid_duration = VideoFileClip(video_dest+top1['name_hash']+'.mp4').duration
|
|
|
- user_obj = first(db.query('SELECT * FROM users where id ="'+str(user_id)+'"'))
|
|
|
- line_token = user_obj['line_token'] # aa
|
|
|
- left_time = user_obj['left_time']
|
|
|
- email = user_obj['email']
|
|
|
+ line_token=''
|
|
|
+ left_time=10000
|
|
|
+ email=''
|
|
|
+ if user_id!=-1:
|
|
|
+ user_obj = first(db.query('SELECT * FROM users where id ="'+str(user_id)+'"'))
|
|
|
+ line_token = user_obj['line_token'] # aa
|
|
|
+ left_time = user_obj['left_time']
|
|
|
+ email = user_obj['email']
|
|
|
+
|
|
|
print('left_time is '+str(left_time))
|
|
|
db.query('UPDATE history_input SET duration ='+str(vid_duration)+' WHERE id='+str(video_id)+';')
|
|
|
if left_time is None:
|
|
@@ -1027,7 +1032,8 @@ def gen_video_queue(name_hash,name,text_content, image_urls,avatar,multiLang,vid
|
|
|
#notify_line_user(msg, line_token)
|
|
|
else:
|
|
|
left_time = left_time - vid_duration
|
|
|
- db.query('UPDATE users SET left_time ='+str(left_time)+' WHERE id='+str(user_id)+';')
|
|
|
+ if user_id != -1:
|
|
|
+ db.query('UPDATE users SET left_time ='+str(left_time)+' WHERE id='+str(user_id)+';')
|
|
|
notify_group(name+"的影片已經產生完成囉! www.choozmo.com:8168/"+video_sub_folder+name_hash+".mp4")
|
|
|
#notify_line_user(name+"的影片已經產生完成囉! www.choozmo.com:8168/"+video_sub_folder+name_hash+".mp4", line_token)
|
|
|
except Exception as e:
|