diff --git a/plexapi/library.py b/plexapi/library.py index 93801a1d7..4f85f63c8 100644 --- a/plexapi/library.py +++ b/plexapi/library.py @@ -2211,6 +2211,7 @@ class Hub(PlexObject): items (list): List of items in the hub. key (str): API URL for the hub. more (bool): True if there are more items to load (call reload() to fetch all items). + random (bool): True if the items in the hub are randomized. size (int): The number of items in the hub. style (str): The style of the hub. title (str): The title of the hub. @@ -2227,6 +2228,7 @@ def _loadData(self, data): self.items = self.findItems(data) self.key = data.attrib.get('key') self.more = utils.cast(bool, data.attrib.get('more')) + self.random = utils.cast(bool, data.attrib.get('random', '0')) self.size = utils.cast(int, data.attrib.get('size')) self.style = data.attrib.get('style') self.title = data.attrib.get('title') diff --git a/tests/test_video.py b/tests/test_video.py index e7f9c8dbe..fb1f0bc09 100644 --- a/tests/test_video.py +++ b/tests/test_video.py @@ -569,6 +569,7 @@ def test_video_Movie_hubs(movies): assert len(hub.items) == hub.size assert utils.is_metadata(hub.key) assert hub.more is False + assert hub.random is False assert hub.size == 1 assert hub.style in (None, "shelf") assert hub.title == "Related Movies"