same as last commit

master
Aevann 2024-10-29 21:10:54 +03:00
parent 4b397eb1ef
commit 090ba46f28
1 changed files with 2 additions and 4 deletions

View File

@ -450,19 +450,17 @@ def _cleanup_videos():
)
for post in unpublished_drafts:
if post.media_usages:
print(f'draft post: {post.id}', flush=True)
print(f'deleted videos in draft post: {post.id}', flush=True)
for media_usage in post.media_usages:
if not media_usage.removed_utc:
print(f'media usage: {media_usage.id}', flush=True)
media_usage.removed_utc = time.time()
g.db.add(media_usage)
for comment in post.comments:
if comment.media_usages:
print(f'draft comment: {comment.id}', flush=True)
print(f'deleted videos in draft comment: {comment.id}', flush=True)
for media_usage in comment.media_usages:
if not media_usage.removed_utc:
print(f'media usage: {media_usage.id}', flush=True)
media_usage.removed_utc = time.time()
g.db.add(media_usage)