fix print and add more

master
Aevann 2024-10-25 00:58:52 +03:00
parent 9bdafda769
commit 740cddc799
1 changed files with 4 additions and 1 deletions

View File

@ -448,17 +448,20 @@ def _cleanup_videos():
Post.deleted_utc == 0, Post.deleted_utc == 0,
) )
for post in unpublished_drafts: for post in unpublished_drafts:
print(f'draft: {media_usage.filename} - {media_usage.post_id} - {media_usage.comment_id}', flush=True) print(f'draft post: {post.id}', flush=True)
post.deleted_utc = time.time() post.deleted_utc = time.time()
g.db.add(post) g.db.add(post)
for media_usage in post.media_usages: for media_usage in post.media_usages:
print(f'media usage: {media_usage.id}', flush=True)
media_usage.deleted_utc = post.deleted_utc media_usage.deleted_utc = post.deleted_utc
g.db.add(media_usage) g.db.add(media_usage)
for comment in post.comments: for comment in post.comments:
print(f'draft comment: {comment.id}', flush=True)
comment.deleted_utc = time.time() comment.deleted_utc = time.time()
g.db.add(comment) g.db.add(comment)
for media_usage in comment.media_usages: for media_usage in comment.media_usages:
print(f'media usage: {media_usage.id}', flush=True)
media_usage.deleted_utc = comment.deleted_utc media_usage.deleted_utc = comment.deleted_utc
g.db.add(media_usage) g.db.add(media_usage)