From 02f1d0857089a79e7d94eec2ef68788000b927d8 Mon Sep 17 00:00:00 2001 From: tcely Date: Thu, 19 Dec 2024 16:36:15 -0500 Subject: [PATCH] Use mkdir_p in models.py --- tubesync/sync/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tubesync/sync/models.py b/tubesync/sync/models.py index babbebb6..d73ac11e 100644 --- a/tubesync/sync/models.py +++ b/tubesync/sync/models.py @@ -19,7 +19,8 @@ from common.utils import clean_filename, clean_emoji from .youtube import (get_media_info as get_youtube_media_info, download_media as download_youtube_media, get_channel_image_info as get_youtube_channel_image_info) -from .utils import seconds_to_timestr, parse_media_format, write_text_file +from .utils import (seconds_to_timestr, parse_media_format, write_text_file, + mkdir_p) from .matching import (get_best_combined_format, get_best_audio_format, get_best_video_format) from .mediaservers import PlexMediaServer @@ -1530,8 +1531,7 @@ class Media(models.Model): if old_video_path.exists() and not new_video_path.exists(): old_video_path = old_video_path.resolve(strict=True) - # mkdir -p destination_dir - new_video_path.parent.mkdir(parents=True, exist_ok=True) + mkdir_p(new_video_path.parent) # build the glob to match other files stem = Path(old_video_path.stem)