update video.optimize method to use new Locations attributes

This commit is contained in:
blacktwin 2020-06-09 15:57:47 -04:00
parent ad55514be9
commit 43b1bfb64b

View file

@ -157,6 +157,13 @@ class Video(PlexPartialObject):
if targetTagID not in tagIDs and (deviceProfile is None or videoQuality is None):
raise BadRequest('Unexpected or missing quality profile.')
libraryLocationIDs = [location.id for location in self.section().locations]
libraryLocationIDs.append(-1)
if locationID not in libraryLocationIDs:
raise BadRequest('Unexpected library path ID. %s not in %s' %
(locationID, libraryLocationIDs))
if isinstance(targetTagID, str):
tagIndex = tagKeys.index(targetTagID)
targetTagID = tagValues[tagIndex]