Skill search works both ways

master
Bob Mottram 2019-08-28 09:41:49 +01:00
parent 7aa9024748
commit 6c7f983c9d
1 changed files with 4 additions and 2 deletions

View File

@ -308,7 +308,8 @@ def htmlSkillsSearch(baseDir: str,skillsearch: str,postsPerPage: int) -> str:
actorJson=commentjson.load(fp) actorJson=commentjson.load(fp)
if actorJson.get('skills') and actorJson.get('name') and actorJson.get('icon'): if actorJson.get('skills') and actorJson.get('name') and actorJson.get('icon'):
for skillName,skillLevel in actorJson['skills'].items(): for skillName,skillLevel in actorJson['skills'].items():
if skillName.lower() in skillsearch: skillName=skillName.lower()
if skillName in skillsearch or skillsearch in skillName:
skillLevelStr=str(skillLevel) skillLevelStr=str(skillLevel)
if skillLevel<100: if skillLevel<100:
skillLevelStr='0'+skillLevelStr skillLevelStr='0'+skillLevelStr
@ -334,7 +335,8 @@ def htmlSkillsSearch(baseDir: str,skillsearch: str,postsPerPage: int) -> str:
actorJson=cachedActorJson['actor'] actorJson=cachedActorJson['actor']
if actorJson.get('skills') and actorJson.get('name') and actorJson.get('icon'): if actorJson.get('skills') and actorJson.get('name') and actorJson.get('icon'):
for skillName,skillLevel in actorJson['skills'].items(): for skillName,skillLevel in actorJson['skills'].items():
if skillName.lower() in skillsearch: skillName=skillName.lower()
if skillName in skillsearch or skillsearch in skillName:
skillLevelStr=str(skillLevel) skillLevelStr=str(skillLevel)
if skillLevel<100: if skillLevel<100:
skillLevelStr='0'+skillLevelStr skillLevelStr='0'+skillLevelStr