Nearly done rework of the whole application to add groups

This commit is contained in:
2026-07-11 22:06:18 -04:00
parent 8db9f3bd9f
commit d8a071a965
6 changed files with 251 additions and 136 deletions

View File

@@ -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: