From 863bd54f867258368a0d756df864714f0b65dbc0 Mon Sep 17 00:00:00 2001 From: kermit Date: Wed, 2 Dec 2020 16:57:17 +0000 Subject: [PATCH] Directory overrides for docker --- deemix/utils/localpaths.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/deemix/utils/localpaths.py b/deemix/utils/localpaths.py index 4e50da1..e9a39b0 100644 --- a/deemix/utils/localpaths.py +++ b/deemix/utils/localpaths.py @@ -7,7 +7,9 @@ userdata = "" musicdata = "" -if os.getenv("XDG_CONFIG_HOME"): +if os.getenv("DEEMIX_DATA_DIR"): + userdata = Path(os.getenv("DEEMIX_DATA_DIR")) +elif os.getenv("XDG_CONFIG_HOME"): userdata = Path(os.getenv("XDG_CONFIG_HOME")) / 'deemix' elif os.getenv("APPDATA"): userdata = Path(os.getenv("APPDATA")) / "deemix" @@ -16,7 +18,9 @@ elif sys.platform.startswith('darwin'): else: userdata = homedata / '.config' / 'deemix' -if os.getenv("XDG_MUSIC_DIR"): +if os.getenv("DEEMIX_MUSIC_DIR"): + musicdata = Path(os.getenv("DEEMIX_MUSIC_DIR")) +elif os.getenv("XDG_MUSIC_DIR"): musicdata = Path(os.getenv("XDG_MUSIC_DIR")) / "deemix Music" elif os.name == 'nt': import winreg @@ -33,9 +37,6 @@ elif os.name == 'nt': else: musicdata = homedata / "Music" / "deemix Music" -def getHomeFolder(): - return homedata - def getConfigFolder(): return userdata