forked from indymedia/epicyon
Case insensitive getting of avatar from cache
parent
7c5c994835
commit
4c23db46c5
6
cache.py
6
cache.py
|
@ -10,7 +10,7 @@ import os
|
||||||
import datetime
|
import datetime
|
||||||
from utils import loadJson
|
from utils import loadJson
|
||||||
from utils import saveJson
|
from utils import saveJson
|
||||||
|
from utils import getFileCaseInsensitive
|
||||||
|
|
||||||
def storePersonInCache(baseDir: str, personUrl: str,
|
def storePersonInCache(baseDir: str, personUrl: str,
|
||||||
personJson: {}, personCache: {}) -> None:
|
personJson: {}, personCache: {}) -> None:
|
||||||
|
@ -40,8 +40,8 @@ def getPersonFromCache(baseDir: str, personUrl: str, personCache: {}) -> {}:
|
||||||
if not personCache.get(personUrl):
|
if not personCache.get(personUrl):
|
||||||
cacheFilename = baseDir + '/cache/actors/' + \
|
cacheFilename = baseDir + '/cache/actors/' + \
|
||||||
personUrl.replace('/', '#')+'.json'
|
personUrl.replace('/', '#')+'.json'
|
||||||
if os.path.isfile(cacheFilename):
|
if os.path.isfile(getFileCaseInsensitive(cacheFilename)):
|
||||||
personJson = loadJson(cacheFilename)
|
personJson = loadJson(getFileCaseInsensitive(cacheFilename))
|
||||||
if personJson:
|
if personJson:
|
||||||
storePersonInCache(baseDir, personUrl, personJson, personCache)
|
storePersonInCache(baseDir, personUrl, personJson, personCache)
|
||||||
loadedFromFile = True
|
loadedFromFile = True
|
||||||
|
|
Loading…
Reference in New Issue