You can now toggle notifications per user from the users profile page.

The PlexWatch importer will now also import those users into the PlexPy db.
This commit is contained in:
Tim 2015-07-26 00:34:34 +02:00
commit 881b25a8d4
7 changed files with 101 additions and 54 deletions

View file

@ -386,7 +386,7 @@ def dbcheck():
'CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY AUTOINCREMENT, '
'user_id INTEGER DEFAULT NULL UNIQUE, username TEXT NOT NULL UNIQUE, '
'friendly_name TEXT, thumb TEXT, email TEXT, is_home_user INTEGER DEFAULT NULL, '
'is_allow_sync INTEGER DEFAULT NULL, is_restricted INTEGER DEFAULT NULL)'
'is_allow_sync INTEGER DEFAULT NULL, is_restricted INTEGER DEFAULT NULL, do_notify INTEGER DEFAULT 1)'
)
# Upgrade sessions table from earlier versions
@ -531,6 +531,15 @@ def dbcheck():
'agent_id INTEGER, agent_name TEXT, on_play INTEGER, on_stop INTEGER, on_watched INTEGER)'
)
# Upgrade sessions table from earlier versions
try:
c_db.execute('SELECT do_notify from users')
except sqlite3.OperationalError:
logger.debug(u"Altering database. Updating database table sessions.")
c_db.execute(
'ALTER TABLE users ADD COLUMN do_notify INTEGER DEFAULT 1'
)
conn_db.commit()
c_db.close()