channel may be None.

This commit is contained in:
Roland 2022-01-16 13:37:44 -07:00
parent 6f58a2b563
commit f305d7912f
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93

View file

@ -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: