mirror of https://gitlab.com/bashrc2/epicyon
cache post filename
parent
8dc02ae340
commit
8283edd34e
8
utils.py
8
utils.py
|
@ -120,7 +120,7 @@ def getDisplayName(baseDir: str,actor: str,personCache: {}) -> str:
|
||||||
return personCache[actor]['actor']['name']
|
return personCache[actor]['actor']['name']
|
||||||
else:
|
else:
|
||||||
# Try to obtain from the cached actors
|
# Try to obtain from the cached actors
|
||||||
cachedActorFilename=baseDir+'/cache/actors/'+actor.replace('/','#')+'.json'
|
cachedActorFilename=baseDir+'/cache/actors/'+(actor.replace('/','#'))+'.json'
|
||||||
if os.path.isfile(cachedActorFilename):
|
if os.path.isfile(cachedActorFilename):
|
||||||
actorJson=loadJson(cachedActorFilename,1)
|
actorJson=loadJson(cachedActorFilename,1)
|
||||||
if actorJson:
|
if actorJson:
|
||||||
|
@ -456,11 +456,9 @@ def getCachedPostFilename(baseDir: str,nickname: str,domain: str, \
|
||||||
return None
|
return None
|
||||||
cachedPostFilename= \
|
cachedPostFilename= \
|
||||||
cachedPostDir+ \
|
cachedPostDir+ \
|
||||||
'/'+postJsonObject['id'].replace('/activity','')
|
'/'+postJsonObject['id'].replace('/activity','').replace('/','#')
|
||||||
print('CACHE: 1 '+nickname+' '+domain+' '+cachedPostFilename)
|
print('CACHE: 1 '+nickname+' '+domain+' '+cachedPostFilename)
|
||||||
if '#' in cachedPostFilename:
|
cachedPostFilename=cachedPostFilename+'.html'
|
||||||
cachedPostFilename=cachedPostFilename.split('#',1)[0]
|
|
||||||
cachedPostFilename=cachedPostFilename.replace('/','#')+'.html'
|
|
||||||
print('CACHE: 2'+cachedPostFilename)
|
print('CACHE: 2'+cachedPostFilename)
|
||||||
return cachedPostFilename
|
return cachedPostFilename
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue