From d514db2b7649dd0a10819fc515620ebe3499d878 Mon Sep 17 00:00:00 2001 From: RemixDev Date: Fri, 30 Oct 2020 15:38:21 +0100 Subject: [PATCH] Fixed folder issue with Windows, updated to 1.5.19 --- deemix/__init__.py | 2 +- deemix/utils/localpaths.py | 7 ++++++- setup.py | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/deemix/__init__.py b/deemix/__init__.py index becf04a..0dc2e61 100644 --- a/deemix/__init__.py +++ b/deemix/__init__.py @@ -1,3 +1,3 @@ #!/usr/bin/env python3 -__version__ = "1.5.18" +__version__ = "1.5.19" diff --git a/deemix/utils/localpaths.py b/deemix/utils/localpaths.py index 8ad00e0..4e50da1 100644 --- a/deemix/utils/localpaths.py +++ b/deemix/utils/localpaths.py @@ -23,7 +23,12 @@ elif os.name == 'nt': sub_key = r'SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders' music_guid = '{4BD8D571-6D19-48D3-BE97-422220080E43}' with winreg.OpenKey(winreg.HKEY_CURRENT_USER, sub_key) as key: - location = winreg.QueryValueEx(key, music_guid)[0] + location = None + try: location = winreg.QueryValueEx(key, music_guid)[0] + except: pass + try: location = winreg.QueryValueEx(key, 'My Music')[0] + except: pass + if not location: location = homedata / "Music" musicdata = Path(location) / "deemix Music" else: musicdata = homedata / "Music" / "deemix Music" diff --git a/setup.py b/setup.py index d9790ba..384ea44 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ README = (HERE / "README.md").read_text() setup( name="deemix", - version="1.5.18", + version="1.5.19", description="A barebone deezer downloader library", long_description=README, long_description_content_type="text/markdown",