Skip to content

Commit 06819fa

Browse files
committed
Update MediaContainer attributes if previously None when extending
1 parent ac81850 commit 06819fa

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

plexapi/base.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,6 +1069,22 @@ def extend(
10691069
self.offset if self.offset is not None else __iterable.offset
10701070
)
10711071

1072+
# for all other attributes, overwrite with the new iterable's values if previously None
1073+
for key in (
1074+
"allowSync",
1075+
"augmentationKey",
1076+
"identifier",
1077+
"librarySectionID",
1078+
"librarySectionTitle",
1079+
"librarySectionUUID",
1080+
"mediaTagPrefix",
1081+
"mediaTagVersion",
1082+
):
1083+
if (not hasattr(self, key)) or (getattr(self, key) is None):
1084+
if not hasattr(__iterable, key):
1085+
continue
1086+
setattr(self, key, getattr(__iterable, key))
1087+
10721088
def _loadData(self, data):
10731089
self._data = data
10741090
self.allowSync = utils.cast(int, data.attrib.get('allowSync'))

0 commit comments

Comments
 (0)