33
44MEDIA_DIR = ""
55VIDEO_DIR = ""
6+ VIDEO_OUTPUT_DIR = ""
67TEX_DIR = ""
78
89def initialize_directories (config ):
910 global MEDIA_DIR
1011 global VIDEO_DIR
12+ global VIDEO_OUTPUT_DIR
1113 global TEX_DIR
12- if not (config ["video_dir" ] and config ["tex_dir" ]):
14+
15+ video_path_specified = config ["video_dir" ] or config ["video_output_dir" ]
16+ if not video_path_specified :
17+ VIDEO_DIR = os .path .join (MEDIA_DIR , "videos" )
18+ elif config ["video_output_dir" ]:
19+ VIDEO_OUTPUT_DIR = config ["video_output_dir" ]
20+ else :
21+ VIDEO_DIR = config ["video_dir" ]
22+
23+ TEX_DIR = config ["tex_dir" ] or os .path .join (MEDIA_DIR , "Tex" )
24+
25+ if not (video_path_specified and config ["tex_dir" ]):
1326 if config ["media_dir" ]:
1427 MEDIA_DIR = config ["media_dir" ]
1528 else :
@@ -26,14 +39,12 @@ def initialize_directories(config):
2639 else :
2740 if config ["media_dir" ]:
2841 print (
29- "Ignoring --media_dir, since --video_dir and --tex_dir were "
30- "both passed"
42+ "Ignoring --media_dir, since both --tex_dir and a video "
43+ "directory were both passed"
3144 )
32- VIDEO_DIR = config ["video_dir" ] or os .path .join (MEDIA_DIR , "videos" )
33- TEX_DIR = config ["tex_dir" ] or os .path .join (MEDIA_DIR , "Tex" )
3445
35- for folder in [VIDEO_DIR , TEX_DIR ]:
36- if not os .path .exists (folder ):
46+ for folder in [VIDEO_DIR , VIDEO_OUTPUT_DIR , TEX_DIR ]:
47+ if folder != "" and not os .path .exists (folder ):
3748 os .makedirs (folder )
3849
3950TEX_USE_CTEX = False
0 commit comments