diff --git a/modules/videos/lib.py b/modules/videos/lib.py index e05cacad..08439353 100644 --- a/modules/videos/lib.py +++ b/modules/videos/lib.py @@ -439,7 +439,8 @@ def upsert_video(session: Session, video_path: pathlib.Path, channel: Channel = if channel and not str(video_path).startswith(str(channel.directory.path)): raise ValueError(f'Video path is not within its channel {video_path=} not in {channel.directory=}') - video.channel_id = channel.id + if channel: + video.channel_id = channel.id video.idempotency = idempotency try: