diff options
| author | Terry Truong <terry06890@gmail.com> | 2022-05-04 01:17:06 +1000 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2022-05-04 01:17:06 +1000 |
| commit | 90a5e15bb824b84e5bb60337d6a57a1394090dc6 (patch) | |
| tree | 661ea356c8d83b74d16f19d3555b0a1d3eb6eb56 /backend/data/reviewImgs.py | |
| parent | ec29e5731136c74a1991e2f93b5e233747f2a230 (diff) | |
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.
Diffstat (limited to 'backend/data/reviewImgs.py')
| -rwxr-xr-x | backend/data/reviewImgs.py | 8 |
1 files changed, 5 insertions, 3 deletions
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: |
