From 8f48e1b0d2cf1310de561ad92ef38d4ce36ddc36 Mon Sep 17 00:00:00 2001 From: Roland Date: Fri, 7 Jan 2022 14:46:03 -0700 Subject: [PATCH] Commiting using channel session. --- modules/videos/lib.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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)