download edit

This commit is contained in:
t0is 2025-04-05 15:25:04 +02:00
parent cbdfa9f76a
commit 42fba5391a

View File

@ -74,6 +74,9 @@ def db_set_col(db, video_id, column, value=True):
Also updates the updated_at timestamp.
"""
cursor = db.cursor()
if column == "data_downloaded":
query = f"UPDATE videos SET {column} = %s, download_end=NOW() WHERE id = %s"
else:
query = f"UPDATE videos SET {column} = %s WHERE id = %s"
cursor.execute(query, (value, video_id))
db.commit()
@ -88,7 +91,7 @@ def try_lock_video(db, video_id):
cursor = db.cursor()
query = """
UPDATE videos
SET data_downloading = 1, updated_at = NOW()
SET data_downloading = 1, updated_at = NOW(), download_start = NOW()
WHERE id = %s AND data_downloading = 0
"""
cursor.execute(query, (video_id,))