Skip to content

Commit 4906c1c

Browse files
authored
Merge pull request #398 from jjlawren/skip_reload_for_session
Skip attr reload for 'session'
2 parents 4ea81af + f83bfd6 commit 4906c1c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

plexapi/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from plexapi.exceptions import BadRequest, NotFound, UnknownType, Unsupported
77
from plexapi.utils import tag_helper
88

9+
DONT_RELOAD_FOR_KEYS = ['key', 'session']
910
OPERATORS = {
1011
'exact': lambda v, q: v == q,
1112
'iexact': lambda v, q: v.lower() == q.lower(),
@@ -278,7 +279,8 @@ def __getattribute__(self, attr):
278279
# Dragons inside.. :-/
279280
value = super(PlexPartialObject, self).__getattribute__(attr)
280281
# Check a few cases where we dont want to reload
281-
if attr == 'key' or attr.startswith('_'): return value
282+
if attr in DONT_RELOAD_FOR_KEYS: return value
283+
if attr.startswith('_'): return value
282284
if value not in (None, []): return value
283285
if self.isFullObject(): return value
284286
# Log the reload.

0 commit comments

Comments
 (0)