check if rating key is episode or movie and is watched. if not, kill script

This commit is contained in:
Blacktwin 2019-06-25 10:50:21 -04:00
parent 1a13d98cd2
commit 2d2d88f58c

View File

@ -527,10 +527,11 @@ if __name__ == '__main__':
print("Request manually triggered to update watch status") print("Request manually triggered to update watch status")
watchedFrom = check_users_access(plex_access, userFrom, serverFrom) watchedFrom = check_users_access(plex_access, userFrom, serverFrom)
watched_item = watchedFrom.fetchItem(opts.ratingKey) watched_item = watchedFrom.fetchItem(opts.ratingKey)
if not watched_item.isWatched: if watched_item.type in ["episode", "movie"]:
print("Rating Key {} was not reported as watched in Plex for user {}".format(opts.ratingKey, if not watched_item.isWatched:
userFrom)) print("Rating Key {} was not reported as watched in Plex for user {}".format(opts.ratingKey,
exit() userFrom))
exit()
for user, server_name in opts.userTo: for user, server_name in opts.userTo:
# Check access and connect # Check access and connect