From ac41da1da3d7118189e651c5016e766358bd6aa9 Mon Sep 17 00:00:00 2001 From: blacktwin Date: Mon, 22 Jun 2020 13:58:45 -0400 Subject: [PATCH] keep previous role if one existed to clear a role use `role=''` --- plexapi/video.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plexapi/video.py b/plexapi/video.py index 666f1966..9a9cf45f 100644 --- a/plexapi/video.py +++ b/plexapi/video.py @@ -368,6 +368,7 @@ class Movie(Playable, Video): thumb (str): URL to image file. """ edits = {} + actors = {actor.tag: actor for actor in self.actors} actor = 'actor[%s]' % index if name: edits['%s.tag.tag' % actor] = name @@ -375,6 +376,10 @@ class Movie(Playable, Video): raise BadRequest('name keyword is required.') if role or type(role) == str: edits['%s.tagging.text' % actor] = role + else: + previousRole = actors.get(name) + if previousRole: + edits['%s.tagging.text' % actor] = previousRole.role if thumb: edits['%s.tag.thumb' % actor] = thumb