File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -96,7 +96,12 @@ def section(self, title):
9696 try :
9797 sections = self ._sectionsByTitle [normalized_title ]
9898 except KeyError :
99- raise NotFound (f'Invalid library section: { title } ' ) from None
99+ # Invalidate cached libraries and try again
100+ self ._invalidateCachedProperties ()
101+ try :
102+ sections = self ._sectionsByTitle [normalized_title ]
103+ except KeyError :
104+ raise NotFound (f'Invalid library section: { title } ' ) from None
100105
101106 if len (sections ) > 1 :
102107 warnings .warn (
@@ -117,7 +122,12 @@ def sectionByID(self, sectionID):
117122 try :
118123 return self ._sectionsByID [sectionID ]
119124 except KeyError :
120- raise NotFound (f'Invalid library sectionID: { sectionID } ' ) from None
125+ # Invalidate cached libraries and try again
126+ self ._invalidateCachedProperties ()
127+ try :
128+ return self ._sectionsByID [sectionID ]
129+ except KeyError :
130+ raise NotFound (f'Invalid library sectionID: { sectionID } ' ) from None
121131
122132 def hubs (self , sectionID = None , identifier = None , ** kwargs ):
123133 """ Returns a list of :class:`~plexapi.library.Hub` across all library sections.
You can’t perform that action at this time.
0 commit comments