From 6c7f983c9d116cc479acab302c95b0719abf7570 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 28 Aug 2019 09:41:49 +0100 Subject: [PATCH] Skill search works both ways --- webinterface.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/webinterface.py b/webinterface.py index 20fc6a84..7de1b55e 100644 --- a/webinterface.py +++ b/webinterface.py @@ -308,7 +308,8 @@ def htmlSkillsSearch(baseDir: str,skillsearch: str,postsPerPage: int) -> str: actorJson=commentjson.load(fp) if actorJson.get('skills') and actorJson.get('name') and actorJson.get('icon'): 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) if skillLevel<100: skillLevelStr='0'+skillLevelStr @@ -334,7 +335,8 @@ def htmlSkillsSearch(baseDir: str,skillsearch: str,postsPerPage: int) -> str: actorJson=cachedActorJson['actor'] if actorJson.get('skills') and actorJson.get('name') and actorJson.get('icon'): 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) if skillLevel<100: skillLevelStr='0'+skillLevelStr