Add default thumb and art to Live TV library

This commit is contained in:
JonnyWong16 2020-09-26 18:32:13 -07:00
parent bfa4d3dfec
commit ccf0e0dae7
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
4 changed files with 20 additions and 0 deletions

View file

@ -1943,6 +1943,19 @@ def dbcheck():
'ALTER TABLE library_sections ADD COLUMN is_active INTEGER DEFAULT 1'
)
# Upgrade library_sections table from earlier versions
try:
result = c_db.execute('SELECT thumb, art FROM library_sections WHERE section_id = ?',
[common.LIVE_TV_SECTION_ID]).fetchone()
if result and (not result[0] or not result[1]):
logger.debug("Altering database. Updating database table library_sections.")
c_db.execute('UPDATE library_sections SET thumb = ?, art =? WHERE section_id = ?',
[common.DEFAULT_LIVE_TV_THUMB,
common.DEFAULT_LIVE_TV_ART_FULL,
common.LIVE_TV_SECTION_ID])
except sqlite3.OperationalError:
pass
# Upgrade users table from earlier versions (remove UNIQUE constraint on username)
try:
result = c_db.execute('SELECT SQL FROM sqlite_master WHERE type="table" AND name="users"').fetchone()