Update plexapi==4.15.11

This commit is contained in:
JonnyWong16 2024-03-31 16:11:00 -07:00
parent 653a6d5c12
commit 85519b1b45
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
8 changed files with 173 additions and 16 deletions

View file

@ -136,6 +136,19 @@ def registerPlexObject(cls):
return cls
def getPlexObject(ehash, default):
""" Return the PlexObject class for the specified ehash. This recursively looks up the class
with the highest specificity, falling back to the default class if not found.
"""
cls = PLEXOBJECTS.get(ehash)
if cls is not None:
return cls
if '.' in ehash:
ehash = ehash.rsplit('.', 1)[0]
return getPlexObject(ehash, default=default)
return PLEXOBJECTS.get(default)
def cast(func, value):
""" Cast the specified value to the specified type (returned by func). Currently this
only support str, int, float, bool. Should be extended if needed.