mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-31 03:50:11 -07:00
Fix missing on_commercial columns in database
This commit is contained in:
parent
6b0b3a476f
commit
87d3c0ae81
2 changed files with 20 additions and 4 deletions
|
@ -754,7 +754,8 @@ def dbcheck():
|
|||
'agent_id INTEGER, agent_name TEXT, agent_label TEXT, friendly_name TEXT, notifier_config TEXT, '
|
||||
'on_play INTEGER DEFAULT 0, on_stop INTEGER DEFAULT 0, on_pause INTEGER DEFAULT 0, '
|
||||
'on_resume INTEGER DEFAULT 0, on_change INTEGER DEFAULT 0, on_buffer INTEGER DEFAULT 0, '
|
||||
'on_error INTEGER DEFAULT 0, on_intro INTEGER DEFAULT 0, on_credits INTEGER DEFAULT 0, '
|
||||
'on_error INTEGER DEFAULT 0, '
|
||||
'on_intro INTEGER DEFAULT 0, on_credits INTEGER DEFAULT 0, on_commercial INTEGER DEFAULT 0, '
|
||||
'on_watched INTEGER DEFAULT 0, on_created INTEGER DEFAULT 0, '
|
||||
'on_extdown INTEGER DEFAULT 0, on_intdown INTEGER DEFAULT 0, '
|
||||
'on_extup INTEGER DEFAULT 0, on_intup INTEGER DEFAULT 0, on_pmsupdate INTEGER DEFAULT 0, '
|
||||
|
@ -762,14 +763,14 @@ def dbcheck():
|
|||
'on_plexpydbcorrupt INTEGER DEFAULT 0, '
|
||||
'on_play_subject TEXT, on_stop_subject TEXT, on_pause_subject TEXT, '
|
||||
'on_resume_subject TEXT, on_change_subject TEXT, on_buffer_subject TEXT, on_error_subject TEXT, '
|
||||
'on_intro_subject TEXT, on_credits_subject TEXT, '
|
||||
'on_intro_subject TEXT, on_credits_subject TEXT, on_commercial_subject TEXT,'
|
||||
'on_watched_subject TEXT, on_created_subject TEXT, on_extdown_subject TEXT, on_intdown_subject TEXT, '
|
||||
'on_extup_subject TEXT, on_intup_subject TEXT, on_pmsupdate_subject TEXT, '
|
||||
'on_concurrent_subject TEXT, on_newdevice_subject TEXT, on_plexpyupdate_subject TEXT, '
|
||||
'on_plexpydbcorrupt_subject TEXT, '
|
||||
'on_play_body TEXT, on_stop_body TEXT, on_pause_body TEXT, '
|
||||
'on_resume_body TEXT, on_change_body TEXT, on_buffer_body TEXT, on_error_body TEXT, '
|
||||
'on_intro_body TEXT, on_credits_body TEXT, '
|
||||
'on_intro_body TEXT, on_credits_body TEXT, on_commercial_body TEXT, '
|
||||
'on_watched_body TEXT, on_created_body TEXT, on_extdown_body TEXT, on_intdown_body TEXT, '
|
||||
'on_extup_body TEXT, on_intup_body TEXT, on_pmsupdate_body TEXT, '
|
||||
'on_concurrent_body TEXT, on_newdevice_body TEXT, on_plexpyupdate_body TEXT, '
|
||||
|
@ -2429,6 +2430,21 @@ def dbcheck():
|
|||
'ALTER TABLE notifiers ADD COLUMN on_credits_body TEXT'
|
||||
)
|
||||
|
||||
# Upgrade notifiers table from earlier versions
|
||||
try:
|
||||
c_db.execute('SELECT on_commercial FROM notifiers')
|
||||
except sqlite3.OperationalError:
|
||||
logger.debug("Altering database. Updating database table notifiers.")
|
||||
c_db.execute(
|
||||
'ALTER TABLE notifiers ADD COLUMN on_commercial INTEGER DEFAULT 0'
|
||||
)
|
||||
c_db.execute(
|
||||
'ALTER TABLE notifiers ADD COLUMN on_commercial_subject TEXT'
|
||||
)
|
||||
c_db.execute(
|
||||
'ALTER TABLE notifiers ADD COLUMN on_commercial_body TEXT'
|
||||
)
|
||||
|
||||
# Upgrade tvmaze_lookup table from earlier versions
|
||||
try:
|
||||
c_db.execute('SELECT rating_key FROM tvmaze_lookup')
|
||||
|
|
|
@ -349,7 +349,7 @@ def available_notification_actions(agent_id=None):
|
|||
'media_types': ('episode',)
|
||||
},
|
||||
{'label': 'Commercial Marker',
|
||||
'name': 'on_credits',
|
||||
'name': 'on_commercial',
|
||||
'description': 'Trigger a notification when a video stream reaches any commercial marker.',
|
||||
'subject': 'Tautulli ({server_name})',
|
||||
'body': '{user} ({player}) has reached a commercial marker for {title}.',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue