mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-21 19:23:05 +00:00
keep previous role if one existed
to clear a role use `role=''`
This commit is contained in:
parent
b7a3deff9e
commit
ac41da1da3
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue