Skip to content

Commit

Permalink
Skip attr reload for 'session'
Browse files Browse the repository at this point in the history
  • Loading branch information
jjlawren committed Nov 10, 2019
1 parent 209f9bd commit f83bfd6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plexapi/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
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(),
Expand Down Expand Up @@ -278,7 +279,8 @@ def __getattribute__(self, attr):
# 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.
Expand Down

0 comments on commit f83bfd6

Please sign in to comment.