diff options
| author | Terry Truong <terry06890@gmail.com> | 2022-05-24 12:10:59 +1000 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2022-05-24 12:10:59 +1000 |
| commit | f8897729154dc25aaef8af40eb3b0d6851ca13b1 (patch) | |
| tree | 21e1e8e07428d67383e6ef17a45a7faee2d87db0 /backend | |
| parent | 02290ae6b9f030a2cc3e6c69c199f9d72ea33ead (diff) | |
Don't generate compound-image if both sub-images non-existent
Diffstat (limited to 'backend')
| -rwxr-xr-x | backend/data/genLinkedImgs.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/backend/data/genLinkedImgs.py b/backend/data/genLinkedImgs.py index d32196e..53a59eb 100755 --- a/backend/data/genLinkedImgs.py +++ b/backend/data/genLinkedImgs.py @@ -96,10 +96,14 @@ for nodeName in processedNodes.keys(): eolIdPair[0] = processedNodes[subName1] if subName2 in processedNodes: eolIdPair[1] = processedNodes[subName2] + # Skip if both subimages not found + if eolIdPair[0] == 0 and eolIdPair[1] == 0: + continue + # Add to db dbCur.execute("UPDATE linked_imgs SET eol_id = ?, eol_id2 = ? WHERE name = ?", (eolIdPair[0], eolIdPair[1], nodeName,)) + # Possibly repeat operation upon parent/ancestors if upPropagateCompoundImgs: - # Repeat operation for parents, where needed while True: # Get parent row = dbCur.execute("SELECT node FROM edges WHERE child = ?", (nodeName,)).fetchone() |
