54 lines
1.4 KiB
Python
Raw Normal View History

"""Module to check for the folders."""
2025-04-24 17:06:14 -04:00
import os
2025-04-24 17:06:14 -04:00
def check_for_config_folder():
"""Check for the config folder."""
if os.path.isdir(os.path.join(os.getcwd(), "configs")):
2025-04-24 17:06:14 -04:00
return
os.mkdir(os.path.join(os.getcwd(), "configs"))
return
2025-04-24 17:06:14 -04:00
2025-04-24 17:06:14 -04:00
def check_for_database_folder():
"""Check for the database folder."""
if os.path.isdir(os.path.join(os.getcwd(), "databases")):
2025-04-24 17:06:14 -04:00
return
os.mkdir(os.path.join(os.getcwd(), "databases"))
os.mkdir(os.path.join(os.getcwd(), "databases", "sql"))
return
2025-04-24 17:06:14 -04:00
2025-04-24 17:06:14 -04:00
def check_for_cdm_folder():
"""Check for the CDM folder."""
if os.path.isdir(os.path.join(os.getcwd(), "configs", "CDMs")):
2025-04-24 17:06:14 -04:00
return
os.mkdir(os.path.join(os.getcwd(), "configs", "CDMs"))
return
2025-04-24 17:06:14 -04:00
2025-04-24 17:06:14 -04:00
def check_for_wv_cdm_folder():
"""Check for the Widevine CDM folder."""
if os.path.isdir(os.path.join(os.getcwd(), "configs", "CDMs", "WV")):
2025-04-24 17:06:14 -04:00
return
os.mkdir(os.path.join(os.getcwd(), "configs", "CDMs", "WV"))
return
2025-04-24 17:06:14 -04:00
2025-04-24 17:06:14 -04:00
def check_for_cdm_pr_folder():
"""Check for the PlayReady CDM folder."""
if os.path.isdir(os.path.join(os.getcwd(), "configs", "CDMs", "PR")):
2025-04-24 17:06:14 -04:00
return
os.mkdir(os.path.join(os.getcwd(), "configs", "CDMs", "PR"))
return
2025-04-24 17:06:14 -04:00
2025-04-24 17:06:14 -04:00
def folder_checks():
"""Check for the folders."""
2025-04-24 17:06:14 -04:00
check_for_config_folder()
check_for_database_folder()
check_for_cdm_folder()
check_for_wv_cdm_folder()
check_for_cdm_pr_folder()