Skip to content

Commit

Permalink
fix #41
Browse files Browse the repository at this point in the history
  • Loading branch information
stevezau committed Jul 23, 2024
1 parent dd78fea commit 66e19d9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plex_generate_previews.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def process_item(item_key):
logger.error('Error generating bundle_file for {} due to {}:{}'.format(media_file, type(e).__name__, str(e)))
continue

bundle_path = os.path.join(PLEX_LOCAL_MEDIA_PATH, bundle_file)
bundle_path = os.path.join(PLEX_LOCAL_MEDIA_PATH, 'localhost', bundle_file)
indexes_path = os.path.join(bundle_path, 'Contents', 'Indexes')
index_bif = os.path.join(indexes_path, 'index-sd.bif')
tmp_path = os.path.join(TMP_FOLDER, bundle_hash)
Expand Down Expand Up @@ -294,6 +294,11 @@ def run():
'%s does not exist, please edit PLEX_LOCAL_MEDIA_PATH environment variable' % PLEX_LOCAL_MEDIA_PATH)
exit(1)

if not os.path.exists(os.path.join(PLEX_LOCAL_MEDIA_PATH, 'localhost')):
logger.error(
'You set PLEX_LOCAL_MEDIA_PATH to "%s". There should be a folder called "localhost" in that directory but it does not exist which suggests you haven\'t mapped it correctly. Please fix the PLEX_LOCAL_MEDIA_PATH environment variable' % PLEX_LOCAL_MEDIA_PATH)
exit(1)

if PLEX_URL == '':
logger.error('Please set the PLEX_URL environment variable')
exit(1)
Expand Down

0 comments on commit 66e19d9

Please sign in to comment.