diff --git a/modules/videos/lib.py b/modules/videos/lib.py index 53c65310..066805e0 100644 --- a/modules/videos/lib.py +++ b/modules/videos/lib.py @@ -176,10 +176,8 @@ def refresh_channel_videos(channel: Channel): logger.info(f'{channel.name}: {len(new_videos)} new videos, {len(existing_paths)} already existed. ') - with get_db_session(commit=True) as session: - # All videos have been discovered, mark the channel as refreshed. - channel.refreshed = True - session.add(channel) + channel.refreshed = True + Session.object_session(channel).commit() apply_info_json(channel.id)