@@ -68,6 +68,7 @@ def __init__( # noqa: C901 # pylint: disable=too-many-arguments
6868 refreshTokens = True ,
6969 fixAPI = True ,
7070 maxAge = None ,
71+ maxAgePictures = None ,
7172 updateCapabilities = True ,
7273 updatePictures = True
7374 ):
@@ -85,6 +86,7 @@ def __init__( # noqa: C901 # pylint: disable=too-many-arguments
8586 self .__cache = dict ()
8687 self .fixAPI = fixAPI
8788 self .maxAge = maxAge
89+ self .maxAgePictures = maxAgePictures
8890 self .latitude = None
8991 self .longitude = None
9092 self .searchRadius = None
@@ -164,19 +166,28 @@ def persistCacheAsJson(self, filename):
164166 json .dump (self .__cache , file , cls = DateTimeEncoder )
165167 LOG .info ('Writing cachefile %s' , filename )
166168
167- def fillCacheFromJson (self , filename , maxAge ):
169+ def fillCacheFromJson (self , filename , maxAge , maxAgePictures = None ):
168170 self .maxAge = maxAge
171+ if maxAgePictures is None :
172+ self .maxAgePictures = maxAge
173+ else :
174+ self .maxAgePictures = maxAgePictures
175+
169176 with open (filename , 'r' ) as file :
170177 self .__cache = json .load (file )
171178 LOG .info ('Reading cachefile %s' , filename )
172179
173- def fillCacheFromJsonString (self , jsonString , maxAge ):
180+ def fillCacheFromJsonString (self , jsonString , maxAge , maxAgePictures = None ):
174181 self .maxAge = maxAge
182+ if maxAgePictures is None :
183+ self .maxAgePictures = maxAge
184+ else :
185+ self .maxAgePictures = maxAgePictures
186+
175187 self .__cache = json .loads (jsonString )
176188 LOG .info ('Reading cache from string' )
177189
178- def clearCache (self , maxAge ):
179- self .maxAge = maxAge
190+ def clearCache (self ):
180191 self .__cache .clear ()
181192 LOG .info ('Clearing cache' )
182193
0 commit comments