summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormorpheus65535 <[email protected]>2021-08-01 10:36:45 -0400
committermorpheus65535 <[email protected]>2021-08-01 10:36:45 -0400
commit360e0cfea19a2d1a285ec42dbbd733fde55ddaf6 (patch)
tree19e12ebd710113221dbd6199fee88fd4c1d947e8
parent9803a1f75616bb9b72f16d4290715ab391a0cc3f (diff)
downloadbazarr-360e0cfea19a2d1a285ec42dbbd733fde55ddaf6.tar.gz
bazarr-360e0cfea19a2d1a285ec42dbbd733fde55ddaf6.zip
Fixed root folders check health functions to use the proper path separator.
-rw-r--r--bazarr/get_rootfolder.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/bazarr/get_rootfolder.py b/bazarr/get_rootfolder.py
index 7027c900f..c7d7770ec 100644
--- a/bazarr/get_rootfolder.py
+++ b/bazarr/get_rootfolder.py
@@ -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 '
@@ -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 '