diff options
| author | Terry Truong <terry06890@gmail.com> | 2022-06-16 01:51:35 +1000 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2022-06-16 01:51:35 +1000 |
| commit | cd78daac266b678d6522158065b67db5aee32df3 (patch) | |
| tree | fa9e6e60534a2254e6349c6b30c0a5360b177b51 | |
| parent | 286041a923b07b968a4d3bde7e02b86990986639 (diff) | |
Fix client-requesting-0.jpg bug
| -rwxr-xr-x | backend/data/genLinkedImgs.py | 4 | ||||
| -rwxr-xr-x | backend/server.py | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/backend/data/genLinkedImgs.py b/backend/data/genLinkedImgs.py index bcc91c5..3f32d16 100755 --- a/backend/data/genLinkedImgs.py +++ b/backend/data/genLinkedImgs.py @@ -89,13 +89,13 @@ for nodeName in processedNodes.keys(): if match != None: # Replace associated image with subname images (subName1, subName2) = match.group(1,2) - otolIdPair = [0, 0] + otolIdPair = [None, None] if subName1 in processedNodes: otolIdPair[0] = processedNodes[subName1] if subName2 in processedNodes: otolIdPair[1] = processedNodes[subName2] # Use no image if both subimages not found - if otolIdPair[0] == 0 and otolIdPair[1] == 0: + if otolIdPair[0] == None and otolIdPair[1] == None: dbCur.execute("DELETE FROM linked_imgs WHERE name = ?", (nodeName,)) continue # Add to db diff --git a/backend/server.py b/backend/server.py index 7d11bc4..2212b13 100755 --- a/backend/server.py +++ b/backend/server.py @@ -68,8 +68,8 @@ def lookupNodes(names, useReducedTree): nodeObjs[name]["imgName"] = otolId + ".jpg" else: nodeObjs[name]["imgName"] = [ - otolId + ".jpg" if otolId != 0 else None, - otolId2 + ".jpg" if otolId2 != 0 else None, + otolId + ".jpg" if otolId != None else None, + otolId2 + ".jpg" if otolId2 != None else None, ] # Get preferred-name info query = f"SELECT name, alt_name FROM names WHERE pref_alt = 1 AND name IN ({queryParamStr})" |
