add sync of rating key from plex server

This commit is contained in:
Blacktwin 2019-06-25 10:32:18 -04:00
parent 12a6875af9
commit 1a13d98cd2

View File

@ -518,6 +518,27 @@ if __name__ == '__main__':
for user in plexTo:
username, server = user
sync_watch_status([watched_item], watched_item.libraryName, server, username)
elif opts.ratingKey and serverFrom != "Tautulli":
plexTo = []
watched_item = []
if userFrom != "Tautulli":
print("Request manually triggered to update watch status")
watchedFrom = check_users_access(plex_access, userFrom, serverFrom)
watched_item = watchedFrom.fetchItem(opts.ratingKey)
if not watched_item.isWatched:
print("Rating Key {} was not reported as watched in Plex for user {}".format(opts.ratingKey,
userFrom))
exit()
for user, server_name in opts.userTo:
# Check access and connect
plexTo.append([user, check_users_access(plex_access, user, server_name, libraries)])
for user in plexTo:
username, server = user
sync_watch_status([watched_item], watched_item.libraryName, server, username)
else:
print("You aren't using this script correctly... bye!")