Skip to content

Commit fabbe18

Browse files
author
Touchstone64
committed
Change the relational key builder to explicitly support filters in its parameters
1 parent f46d498 commit fabbe18

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

plexapi/mixins/tv_parent_child.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,20 @@ class TvParentChildMixin:
55
""" Mixin for Plex objects that have parent/child relationships (episode/season/show). """
66

77
def _buildRelationKey(self, key, **kwargs):
8-
""" Returns a key suitable for fetching parent/child TV items """
9-
if not key:
10-
return None
8+
""" Returns a key suitable for fetching parent/child TV items
119
12-
args = {}
10+
Parameters:
11+
key (str): The relational key being fetched, such as '/children' (may be
12+
empty).
13+
**kwargs (dict): Custom XML attribute filters to apply to add to the
14+
query. See :func:`~plexapi.base.PlexObject.fetchItems` for more
15+
details on how this is used.
1316
14-
args['includeGuids'] = int(bool(kwargs.pop('includeGuids', True)))
15-
for name, value in list(kwargs.items()):
16-
args[name] = value
17+
"""
18+
if not key:
19+
return None
1720

21+
args = {'includeGuids': 1, **kwargs}
1822
params = utils.joinArgs(args).lstrip('?')
1923

2024
return f"{key}?{params}"

0 commit comments

Comments
 (0)