From 90a5e15bb824b84e5bb60337d6a57a1394090dc6 Mon Sep 17 00:00:00 2001 From: Terry Truong Date: Wed, 4 May 2022 01:17:06 +1000 Subject: Add scripts for obtaining/sending/displaying wikipedia descriptions Add backend/data/enwiki/ directory containing scripts and instructive READMEs. Adjust some other scripts to generate 'eol_ids' sqlite table separate from 'names'. Make server respond to /data/desc requests, and have client TileInfo component display response data. Also adjust .gitignore entries to be root-relative. --- backend/data/reviewImgs.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'backend/data/reviewImgs.py') diff --git a/backend/data/reviewImgs.py b/backend/data/reviewImgs.py index 5dcd52e..8987007 100755 --- a/backend/data/reviewImgs.py +++ b/backend/data/reviewImgs.py @@ -125,10 +125,12 @@ class EolImgReviewer: # Update title firstImgIdx = self.imgListIdx - len(self.nextImgNames) + 1 lastImgIdx = self.imgListIdx - row = dbCur.execute("SELECT alt_name, eol_id, pref_alt FROM names WHERE eol_id = ? and pref_alt = 1", - (self.nextEolId,)).fetchone() + query = "SELECT eol_ids.id, names.alt_name, names.pref_alt FROM" \ + " names INNER JOIN eol_ids ON eol_ids.name = names.name" \ + " WHERE id = ? and pref_alt = 1" + row = dbCur.execute(query, (self.nextEolId,)).fetchone() if row != None: - commonName = row[0] + commonName = row[1] self.root.title("Reviewing EOL ID {}, aka \"{}\" (imgs {} to {} out of {})".format( self.nextEolId, commonName, firstImgIdx, lastImgIdx, len(self.imgList))) else: -- cgit v1.2.3