Skip to content

Commit

Permalink
Merge pull request #398 from jjlawren/skip_reload_for_session
Browse files Browse the repository at this point in the history
Skip attr reload for 'session'
  • Loading branch information
pkkid authored Nov 10, 2019
2 parents 4ea81af + f83bfd6 commit 4906c1c
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 4906c1c

Please sign in to comment.