Fixed root folders check health functions to use the proper path separator.

pull/1492/head
morpheus65535 3 years ago
parent 9803a1f756
commit 360e0cfea1

@ -63,8 +63,11 @@ def check_sonarr_rootfolder():
rootfolder = TableShowsRootfolder.select(TableShowsRootfolder.id, TableShowsRootfolder.path).dicts() rootfolder = TableShowsRootfolder.select(TableShowsRootfolder.id, TableShowsRootfolder.path).dicts()
for item in rootfolder: for item in rootfolder:
root_path = item['path'] root_path = item['path']
if not root_path.endswith(os.path.sep): if not root_path.endswith(('/', '\\')):
root_path += os.path.sep if root_path.startswith('/'):
root_path += '/'
else:
root_path += '\\'
if not os.path.isdir(path_mappings.path_replace(root_path)): if not os.path.isdir(path_mappings.path_replace(root_path)):
TableShowsRootfolder.update({TableShowsRootfolder.accessible: 0, TableShowsRootfolder.update({TableShowsRootfolder.accessible: 0,
TableShowsRootfolder.error: 'This Sonarr root directory does not seems to ' TableShowsRootfolder.error: 'This Sonarr root directory does not seems to '
@ -134,8 +137,11 @@ def check_radarr_rootfolder():
rootfolder = TableMoviesRootfolder.select(TableMoviesRootfolder.id, TableMoviesRootfolder.path).dicts() rootfolder = TableMoviesRootfolder.select(TableMoviesRootfolder.id, TableMoviesRootfolder.path).dicts()
for item in rootfolder: for item in rootfolder:
root_path = item['path'] root_path = item['path']
if not root_path.endswith(os.path.sep): if not root_path.endswith(('/', '\\')):
root_path += os.path.sep if root_path.startswith('/'):
root_path += '/'
else:
root_path += '\\'
if not os.path.isdir(path_mappings.path_replace_movie(root_path)): if not os.path.isdir(path_mappings.path_replace_movie(root_path)):
TableMoviesRootfolder.update({TableMoviesRootfolder.accessible: 0, TableMoviesRootfolder.update({TableMoviesRootfolder.accessible: 0,
TableMoviesRootfolder.error: 'This Radarr root directory does not seems to ' TableMoviesRootfolder.error: 'This Radarr root directory does not seems to '

Loading…
Cancel
Save