Case insensitive getting of avatar from cache

main
Bob Mottram 2020-05-04 19:39:21 +01:00
parent 7c5c994835
commit 4c23db46c5
1 changed files with 3 additions and 3 deletions

View File

@ -10,7 +10,7 @@ import os
import datetime
from utils import loadJson
from utils import saveJson
from utils import getFileCaseInsensitive
def storePersonInCache(baseDir: str, personUrl: str,
personJson: {}, personCache: {}) -> None:
@ -40,8 +40,8 @@ def getPersonFromCache(baseDir: str, personUrl: str, personCache: {}) -> {}:
if not personCache.get(personUrl):
cacheFilename = baseDir + '/cache/actors/' + \
personUrl.replace('/', '#')+'.json'
if os.path.isfile(cacheFilename):
personJson = loadJson(cacheFilename)
if os.path.isfile(getFileCaseInsensitive(cacheFilename)):
personJson = loadJson(getFileCaseInsensitive(cacheFilename))
if personJson:
storePersonInCache(baseDir, personUrl, personJson, personCache)
loadedFromFile = True