Setting FileGroup.censored when refreshing channel files.

This commit is contained in:
Roland 2024-06-17 14:48:41 -06:00
parent 1fbfb990f1
commit 0fd545d2e8
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
5 changed files with 62 additions and 13 deletions

View file

@ -657,15 +657,15 @@ class Channel(ModelHelper, Base):
await refresh_files([self.directory], send_events=send_events)
# Apply any info_json (update view counts) second.
from modules.videos.common import update_view_counts
from modules.videos.common import update_view_counts_and_censored
if PYTEST:
await update_view_counts(self_id)
await update_view_counts_and_censored(self_id)
self.refreshed = True
else:
# Perform info_json in background task. Channel will be marked as refreshed after this completes.
async def _():
await update_view_counts(self_id)
await update_view_counts_and_censored(self_id)
with get_db_session(commit=True) as session:
channel: Channel = session.query(Channel).filter(Channel.id == self_id).one()
channel.refreshed = True