From 8b9d44df5c9c5501103e00985f8e8e4e2b3b70a8 Mon Sep 17 00:00:00 2001 From: Roland Date: Fri, 14 Jan 2022 16:06:23 -0700 Subject: [PATCH] Using str to check if video file is relative to channel directory. --- modules/videos/lib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/videos/lib.py b/modules/videos/lib.py index 45c860e6..3768e418 100644 --- a/modules/videos/lib.py +++ b/modules/videos/lib.py @@ -435,8 +435,8 @@ def upsert_video(session: Session, video_path: pathlib.Path, channel: Channel = video.poster_path = poster_path video.video_path = video_path - if channel and not video_path.is_relative_to(channel.directory.path): - raise ValueError(f'Video path is not within its channel {video_path=} {channel.directory=}') + 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 = channel video.idempotency = idempotency