mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Using str to check if video file is relative to channel directory.
This commit is contained in:
parent
b5d5515174
commit
8b9d44df5c
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue