Plex: Fix guids error on mark
This commit is contained in:
12
src/plex.py
12
src/plex.py
@@ -1,4 +1,4 @@
|
||||
import re, requests, os
|
||||
import re, requests, os, traceback
|
||||
from urllib3.poolmanager import PoolManager
|
||||
|
||||
from plexapi.server import PlexServer
|
||||
@@ -52,7 +52,7 @@ def get_user_library_watched_show(show):
|
||||
except:
|
||||
logger(
|
||||
f"Plex: Failed to get guids for {episode.title} in {show.title}, Using location only",
|
||||
4,
|
||||
1,
|
||||
)
|
||||
|
||||
episode_guids_temp["locations"] = tuple(
|
||||
@@ -223,6 +223,7 @@ def update_user_watched(user, user_plex, library, videos, dryrun):
|
||||
break
|
||||
|
||||
if not episode_found:
|
||||
try:
|
||||
for episode_guid in episode_search.guids:
|
||||
episode_guid_source = (
|
||||
re.search(r"(.*)://", episode_guid.id)
|
||||
@@ -241,6 +242,11 @@ def update_user_watched(user, user_plex, library, videos, dryrun):
|
||||
):
|
||||
episode_found = True
|
||||
break
|
||||
except Exception as e:
|
||||
logger(
|
||||
f"Plex: Failed to get episode guid for {episode_search.title}, Error: {e}",
|
||||
1,
|
||||
)
|
||||
|
||||
if episode_found:
|
||||
msg = f"{show_search.title} {episode_search.title} as watched for {user.title} in {library} for Plex"
|
||||
@@ -271,7 +277,7 @@ def update_user_watched(user, user_plex, library, videos, dryrun):
|
||||
f"Plex: Failed to update watched for {user.title} in library {library}, Error: {e}",
|
||||
2,
|
||||
)
|
||||
raise Exception(e)
|
||||
logger(traceback.format_exc(), 2)
|
||||
|
||||
|
||||
# class plex accept base url and token and username and password but default with none
|
||||
|
||||
Reference in New Issue
Block a user