Add MARK/DRYRUN logger levels
This commit is contained in:
24
src/plex.py
24
src/plex.py
@@ -296,21 +296,21 @@ def update_user_watched(user, user_plex, library, videos, dryrun):
|
||||
)
|
||||
if video_status:
|
||||
if video_status["completed"]:
|
||||
msg = f"{movies_search.title} as watched for {user.title} in {library} for Plex"
|
||||
msg = f"Plex: {movies_search.title} as watched for {user.title} in {library}"
|
||||
if not dryrun:
|
||||
logger(f"Marked {msg}", 0)
|
||||
logger(msg, 5)
|
||||
movies_search.markWatched()
|
||||
else:
|
||||
logger(f"Dryrun {msg}", 0)
|
||||
logger(msg, 6)
|
||||
|
||||
log_marked(user.title, library, movies_search.title, None, None)
|
||||
elif video_status["time"] > 60_000:
|
||||
msg = f"{movies_search.title} as partially watched for {floor(video_status['time'] / 60_000)} minutes for {user.title} in {library} for Plex"
|
||||
msg = f"Plex: {movies_search.title} as partially watched for {floor(video_status['time'] / 60_000)} minutes for {user.title} in {library}"
|
||||
if not dryrun:
|
||||
logger(f"Marked {msg}", 0)
|
||||
logger(msg, 5)
|
||||
movies_search.updateProgress(video_status["time"])
|
||||
else:
|
||||
logger(f"Dryrun {msg}", 0)
|
||||
logger(msg, 6)
|
||||
|
||||
log_marked(
|
||||
user.title,
|
||||
@@ -336,12 +336,12 @@ def update_user_watched(user, user_plex, library, videos, dryrun):
|
||||
)
|
||||
if video_status:
|
||||
if video_status["completed"]:
|
||||
msg = f"{show_search.title} {episode_search.title} as watched for {user.title} in {library} for Plex"
|
||||
msg = f"Plex: {show_search.title} {episode_search.title} as watched for {user.title} in {library}"
|
||||
if not dryrun:
|
||||
logger(f"Marked {msg}", 0)
|
||||
logger(msg, 5)
|
||||
episode_search.markWatched()
|
||||
else:
|
||||
logger(f"Dryrun {msg}", 0)
|
||||
logger(msg, 6)
|
||||
|
||||
log_marked(
|
||||
user.title,
|
||||
@@ -350,12 +350,12 @@ def update_user_watched(user, user_plex, library, videos, dryrun):
|
||||
episode_search.title,
|
||||
)
|
||||
else:
|
||||
msg = f"{show_search.title} {episode_search.title} as partially watched for {floor(video_status['time'] / 60_000)} minutes for {user.title} in {library} for Plex"
|
||||
msg = f"Plex: {show_search.title} {episode_search.title} as partially watched for {floor(video_status['time'] / 60_000)} minutes for {user.title} in {library}"
|
||||
if not dryrun:
|
||||
logger(f"Marked {msg}", 0)
|
||||
logger(msg, 5)
|
||||
episode_search.updateProgress(video_status["time"])
|
||||
else:
|
||||
logger(f"Dryrun {msg}", 0)
|
||||
logger(msg, 6)
|
||||
|
||||
log_marked(
|
||||
user.title,
|
||||
|
||||
Reference in New Issue
Block a user