forked from LBRYCommunity/lbry-sdk
if user has no Downloads dir on windows, use cwd
This commit is contained in:
parent
c2dae43965
commit
ecc74e2ae5
1 changed files with 6 additions and 3 deletions
|
@ -630,9 +630,13 @@ class Config(CLIConfig):
|
||||||
|
|
||||||
|
|
||||||
def get_windows_directories() -> typing.Tuple[str, str, str]:
|
def get_windows_directories() -> typing.Tuple[str, str, str]:
|
||||||
from lbry.winpaths import get_path, FOLDERID, UserHandle # pylint: disable=import-outside-toplevel
|
from lbry.winpaths import get_path, FOLDERID, UserHandle, \
|
||||||
|
PathNotFoundException # pylint: disable=import-outside-toplevel
|
||||||
|
|
||||||
|
try:
|
||||||
download_dir = get_path(FOLDERID.Downloads, UserHandle.current)
|
download_dir = get_path(FOLDERID.Downloads, UserHandle.current)
|
||||||
|
except PathNotFoundException:
|
||||||
|
download_dir = os.getcwd()
|
||||||
|
|
||||||
# old
|
# old
|
||||||
appdata = get_path(FOLDERID.RoamingAppData, UserHandle.current)
|
appdata = get_path(FOLDERID.RoamingAppData, UserHandle.current)
|
||||||
|
@ -644,7 +648,6 @@ def get_windows_directories() -> typing.Tuple[str, str, str]:
|
||||||
# new
|
# new
|
||||||
data_dir = user_data_dir('lbrynet', 'lbry')
|
data_dir = user_data_dir('lbrynet', 'lbry')
|
||||||
lbryum_dir = user_data_dir('lbryum', 'lbry')
|
lbryum_dir = user_data_dir('lbryum', 'lbry')
|
||||||
download_dir = get_path(FOLDERID.Downloads, UserHandle.current)
|
|
||||||
return data_dir, lbryum_dir, download_dir
|
return data_dir, lbryum_dir, download_dir
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue