Skip to content

Commit

Permalink
Fixed root folders check health functions to use the proper path sepa…
Browse files Browse the repository at this point in the history
…rator.
  • Loading branch information
morpheus65535 committed Aug 1, 2021
1 parent 9803a1f commit 360e0cf
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions bazarr/get_rootfolder.py
Expand Up @@ -63,8 +63,11 @@ def check_sonarr_rootfolder():
rootfolder = TableShowsRootfolder.select(TableShowsRootfolder.id, TableShowsRootfolder.path).dicts()
for item in rootfolder:
root_path = item['path']
if not root_path.endswith(os.path.sep):
root_path += os.path.sep
if not root_path.endswith(('/', '\\')):
if root_path.startswith('/'):
root_path += '/'
else:
root_path += '\\'
if not os.path.isdir(path_mappings.path_replace(root_path)):
TableShowsRootfolder.update({TableShowsRootfolder.accessible: 0,
TableShowsRootfolder.error: 'This Sonarr root directory does not seems to '
Expand Down Expand Up @@ -134,8 +137,11 @@ def check_radarr_rootfolder():
rootfolder = TableMoviesRootfolder.select(TableMoviesRootfolder.id, TableMoviesRootfolder.path).dicts()
for item in rootfolder:
root_path = item['path']
if not root_path.endswith(os.path.sep):
root_path += os.path.sep
if not root_path.endswith(('/', '\\')):
if root_path.startswith('/'):
root_path += '/'
else:
root_path += '\\'
if not os.path.isdir(path_mappings.path_replace_movie(root_path)):
TableMoviesRootfolder.update({TableMoviesRootfolder.accessible: 0,
TableMoviesRootfolder.error: 'This Radarr root directory does not seems to '
Expand Down

0 comments on commit 360e0cf

Please sign in to comment.