mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-19 04:49:36 -07:00
Remove duplicates from Imgur and Cloudinary lookup tables
This commit is contained in:
parent
c6548c80b3
commit
3422a99fc5
1 changed files with 14 additions and 0 deletions
|
@ -2407,6 +2407,20 @@ def dbcheck():
|
||||||
except sqlite3.OperationalError:
|
except sqlite3.OperationalError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
# Upgrade imgur_lookup table from earlier versions
|
||||||
|
try:
|
||||||
|
c_db.execute('DELETE FROM imgur_lookup '
|
||||||
|
'WHERE id NOT IN (SELECT MIN(id) FROM imgur_lookup GROUP BY img_hash)')
|
||||||
|
except sqlite3.OperationalError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
# Upgrade cloudinary_lookup table from earlier versions
|
||||||
|
try:
|
||||||
|
c_db.execute('DELETE FROM cloudinary_lookup '
|
||||||
|
'WHERE id NOT IN (SELECT MIN(id) FROM cloudinary_lookup GROUP BY img_hash)')
|
||||||
|
except sqlite3.OperationalError:
|
||||||
|
pass
|
||||||
|
|
||||||
# Add "Local" user to database as default unauthenticated user.
|
# Add "Local" user to database as default unauthenticated user.
|
||||||
result = c_db.execute('SELECT id FROM users WHERE username = "Local"')
|
result = c_db.execute('SELECT id FROM users WHERE username = "Local"')
|
||||||
if not result.fetchone():
|
if not result.fetchone():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue