Nearly done rework of the whole application to add groups
This commit is contained in:
@@ -5,7 +5,7 @@ import sqlite3
|
||||
import time
|
||||
import json
|
||||
|
||||
get_active_video = r'''
|
||||
get_active_video_sql = r'''
|
||||
SELECT video_url, video_arguments, button_name FROM buttons
|
||||
WHERE is_active = 1
|
||||
LIMIT 1
|
||||
@@ -29,7 +29,7 @@ def play_video(previous_process, video_player_path, player_arguments, video_url,
|
||||
)
|
||||
|
||||
def get_active_video(db):
|
||||
cursor = db.execute(get_active_video)
|
||||
cursor = db.execute(get_active_video_sql)
|
||||
return cursor.fetchall()[0]
|
||||
|
||||
with open("config.json", "r") as config_file:
|
||||
@@ -45,7 +45,7 @@ db = sqlite3.connect(config_json["db_name"])
|
||||
while True:
|
||||
active_video = get_active_video(db)
|
||||
|
||||
if current_video[2] != active_video[2]:
|
||||
if current_video is None or current_video[2] != active_video[2]:
|
||||
current_video = active_video
|
||||
|
||||
if current_video[2] == config_json["disabled_name"] and not current_process is None:
|
||||
|
||||
Reference in New Issue
Block a user