@@ -541,12 +541,11 @@ def delete(self):
541541 log .error (msg )
542542 raise
543543
544- def reload (self ):
544+ def _reload (self , ** kwargs ):
545545 """ Reload the data for the library section. """
546- self ._server .library ._loadSections ()
547- newLibrary = self ._server .library .sectionByID (self .key )
548- self .__dict__ .update (newLibrary .__dict__ )
549- self ._invalidateCachedProperties ()
546+ key = self ._initpath
547+ data = self ._server .query (key )
548+ self ._findAndLoadElem (data , key = str (self .key ))
550549 return self
551550
552551 def edit (self , agent = None , ** kwargs ):
@@ -2210,10 +2209,10 @@ class Hub(PlexObject):
22102209 context (str): The context of the hub.
22112210 hubKey (str): API URL for these specific hub items.
22122211 hubIdentifier (str): The identifier of the hub.
2213- items (list): List of items in the hub.
2212+ items (list): List of items in the hub (automatically loads all items if more is True) .
22142213 key (str): API URL for the hub.
2215- more (bool): True if there are more items to load (call reload() to fetch all items).
22162214 random (bool): True if the items in the hub are randomized.
2215+ more (bool): True if there are more items to load (call items to fetch all items).
22172216 size (int): The number of items in the hub.
22182217 style (str): The style of the hub.
22192218 title (str): The title of the hub.
@@ -2248,20 +2247,20 @@ def items(self):
22482247 def __len__ (self ):
22492248 return self .size
22502249
2251- def reload (self ):
2252- """ Delete cached data to allow reloading of hub items. """
2253- self ._invalidateCachedProperties ()
2254- if self ._data is not None :
2255- self .more = utils .cast (bool , self ._data .attrib .get ('more' ))
2256- self .size = utils .cast (int , self ._data .attrib .get ('size' ))
2257-
22582250 def section (self ):
22592251 """ Returns the :class:`~plexapi.library.LibrarySection` this hub belongs to.
22602252 """
22612253 if self ._section is None :
22622254 self ._section = self ._server .library .sectionByID (self .librarySectionID )
22632255 return self ._section
22642256
2257+ def _reload (self , ** kwargs ):
2258+ """ Reload the data for the hub. """
2259+ key = self ._initpath
2260+ data = self ._server .query (key )
2261+ self ._findAndLoadElem (data , hubIdentifier = self .hubIdentifier )
2262+ return self
2263+
22652264
22662265class LibraryMediaTag (PlexObject ):
22672266 """ Base class of library media tags.
@@ -3032,11 +3031,11 @@ def _loadData(self, data):
30323031 parent = self ._parent ()
30333032 self .librarySectionID = parent .key if isinstance (parent , LibrarySection ) else parent .librarySectionID
30343033
3035- def reload (self ):
3034+ def _reload (self , ** kwargs ):
30363035 """ Reload the data for this managed hub. """
30373036 key = f'/hubs/sections/{ self .librarySectionID } /manage'
3038- hub = self .fetchItem (key , self . __class__ , identifier = self . identifier )
3039- self .__dict__ . update ( hub . __dict__ )
3037+ data = self ._server . query (key )
3038+ self ._findAndLoadElem ( data , identifier = self . identifier )
30403039 return self
30413040
30423041 def move (self , after = None ):
0 commit comments