fix: reduce pending deletion window from 7 days to 2 hours

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-27 03:34:18 +02:00
parent a3346c6e87
commit 09c11da1ce

View File

@@ -1067,7 +1067,7 @@ def update_progress(
user_id=current_user.id, video_id=video_id, status="complete"
).filter(Download.pending_delete_at.is_(None)).first()
if dl:
dl.pending_delete_at = datetime.utcnow() + timedelta(days=7)
dl.pending_delete_at = datetime.utcnow() + timedelta(hours=2)
elif body.watched and prev_watched:
# Rewatch — strongest positive signal
uv.rewatch_count = (uv.rewatch_count or 0) + 1
@@ -1092,7 +1092,7 @@ def update_progress(
user_id=current_user.id, video_id=video_id, status="complete"
).filter(Download.pending_delete_at.is_(None)).first()
if dl:
dl.pending_delete_at = datetime.utcnow() + timedelta(days=7)
dl.pending_delete_at = datetime.utcnow() + timedelta(hours=2)
db.commit()
return {"ok": True}