Fixes error locating config if not run from src dir

This commit is contained in:
Jonathan Barratt 2021-10-24 11:35:37 +07:00
parent c41fc10bc2
commit 4f91554097
1 changed files with 2 additions and 1 deletions

View File

@ -55,7 +55,8 @@ class ZSpotify:
@classmethod
def load_config(cls) -> None:
with open(CONFIG_FILE_PATH, encoding='utf-8') as config_file:
app_dir = os.path.dirname(__file__)
with open(os.path.join(app_dir, CONFIG_FILE_PATH), encoding='utf-8') as config_file:
cls.CONFIG = json.load(config_file)
@classmethod