Skip attr reload for 'session'

This commit is contained in:
Jason Lawrence 2019-11-09 21:35:33 -06:00
parent 209f9bda5a
commit f83bfd6cc2

View file

@ -6,6 +6,7 @@ from plexapi.compat import quote_plus, urlencode
from plexapi.exceptions import BadRequest, NotFound, UnknownType, Unsupported
from plexapi.utils import tag_helper
DONT_RELOAD_FOR_KEYS = ['key', 'session']
OPERATORS = {
'exact': lambda v, q: v == q,
'iexact': lambda v, q: v.lower() == q.lower(),
@ -278,7 +279,8 @@ class PlexPartialObject(PlexObject):
# Dragons inside.. :-/
value = super(PlexPartialObject, self).__getattribute__(attr)
# Check a few cases where we dont want to reload
if attr == 'key' or attr.startswith('_'): return value
if attr in DONT_RELOAD_FOR_KEYS: return value
if attr.startswith('_'): return value
if value not in (None, []): return value
if self.isFullObject(): return value
# Log the reload.