mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-29 19:18:33 -07:00
Format code and disable button once clicked
This commit is contained in:
parent
8f4034540c
commit
22a4478a06
2 changed files with 29 additions and 16 deletions
|
@ -639,6 +639,7 @@ DOCUMENTATION :: END
|
||||||
|
|
||||||
$('#confirm-modal').modal();
|
$('#confirm-modal').modal();
|
||||||
$('#confirm-modal').one('click', '#confirm-update', function () {
|
$('#confirm-modal').one('click', '#confirm-update', function () {
|
||||||
|
$(this).prop('disabled', true);
|
||||||
var msg = "<i class='fa fa-refresh fa-spin'></i> Updating database..."
|
var msg = "<i class='fa fa-refresh fa-spin'></i> Updating database..."
|
||||||
showMsg(msg, false, false, 0)
|
showMsg(msg, false, false, 0)
|
||||||
|
|
||||||
|
@ -648,7 +649,7 @@ DOCUMENTATION :: END
|
||||||
new_rating_key: new_rating_key,
|
new_rating_key: new_rating_key,
|
||||||
media_type: "${query['media_type']}"
|
media_type: "${query['media_type']}"
|
||||||
},
|
},
|
||||||
async: false,
|
async: true,
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
window.location.href = new_href;
|
window.location.href = new_href;
|
||||||
}
|
}
|
||||||
|
|
|
@ -934,35 +934,47 @@ class DataFactory(object):
|
||||||
logger.info(u"PlexPy DataFactory :: Updating rating keys in the database.")
|
logger.info(u"PlexPy DataFactory :: Updating rating keys in the database.")
|
||||||
for old_key, new_key in mapping.iteritems():
|
for old_key, new_key in mapping.iteritems():
|
||||||
# check rating_key (3 tables)
|
# check rating_key (3 tables)
|
||||||
monitor_db.action('UPDATE session_history SET rating_key = ? WHERE rating_key = ?', [new_key, old_key])
|
monitor_db.action('UPDATE session_history SET rating_key = ? WHERE rating_key = ?',
|
||||||
monitor_db.action('UPDATE session_history_media_info SET rating_key = ? WHERE rating_key = ?', [new_key, old_key])
|
[new_key, old_key])
|
||||||
monitor_db.action('UPDATE session_history_metadata SET rating_key = ? WHERE rating_key = ?', [new_key, old_key])
|
monitor_db.action('UPDATE session_history_media_info SET rating_key = ? WHERE rating_key = ?',
|
||||||
|
[new_key, old_key])
|
||||||
|
monitor_db.action('UPDATE session_history_metadata SET rating_key = ? WHERE rating_key = ?',
|
||||||
|
[new_key, old_key])
|
||||||
|
|
||||||
# check parent_rating_key (2 tables)
|
# check parent_rating_key (2 tables)
|
||||||
monitor_db.action('UPDATE session_history SET parent_rating_key = ? WHERE parent_rating_key = ?', [new_key, old_key])
|
monitor_db.action('UPDATE session_history SET parent_rating_key = ? WHERE parent_rating_key = ?',
|
||||||
monitor_db.action('UPDATE session_history_metadata SET parent_rating_key = ? WHERE parent_rating_key = ?', [new_key, old_key])
|
[new_key, old_key])
|
||||||
|
monitor_db.action('UPDATE session_history_metadata SET parent_rating_key = ? WHERE parent_rating_key = ?',
|
||||||
|
[new_key, old_key])
|
||||||
|
|
||||||
# check grandparent_rating_key (2 tables)
|
# check grandparent_rating_key (2 tables)
|
||||||
monitor_db.action('UPDATE session_history SET grandparent_rating_key = ? WHERE grandparent_rating_key = ?', [new_key, old_key])
|
monitor_db.action('UPDATE session_history SET grandparent_rating_key = ? WHERE grandparent_rating_key = ?',
|
||||||
monitor_db.action('UPDATE session_history_metadata SET grandparent_rating_key = ? WHERE grandparent_rating_key = ?', [new_key, old_key])
|
[new_key, old_key])
|
||||||
|
monitor_db.action('UPDATE session_history_metadata SET grandparent_rating_key = ? WHERE grandparent_rating_key = ?',
|
||||||
|
[new_key, old_key])
|
||||||
|
|
||||||
# check thumb (1 table)
|
# check thumb (1 table)
|
||||||
monitor_db.action('UPDATE session_history_metadata SET thumb = replace(thumb, ?, ?) WHERE thumb LIKE "/library/metadata/%s/thumb/%%"' % old_key,
|
monitor_db.action('UPDATE session_history_metadata SET thumb = replace(thumb, ?, ?) \
|
||||||
|
WHERE thumb LIKE "/library/metadata/%s/thumb/%%"' % old_key,
|
||||||
[old_key, new_key])
|
[old_key, new_key])
|
||||||
|
|
||||||
# check parent_thumb (1 table)
|
# check parent_thumb (1 table)
|
||||||
monitor_db.action('UPDATE session_history_metadata SET parent_thumb = replace(parent_thumb, ?, ?) WHERE parent_thumb LIKE "/library/metadata/%s/thumb/%%"' % old_key,
|
monitor_db.action('UPDATE session_history_metadata SET parent_thumb = replace(parent_thumb, ?, ?) \
|
||||||
|
WHERE parent_thumb LIKE "/library/metadata/%s/thumb/%%"' % old_key,
|
||||||
[old_key, new_key])
|
[old_key, new_key])
|
||||||
|
|
||||||
# check grandparent_thumb (1 table)
|
# check grandparent_thumb (1 table)
|
||||||
monitor_db.action('UPDATE session_history_metadata SET grandparent_thumb = replace(grandparent_thumb, ?, ?) WHERE grandparent_thumb LIKE "/library/metadata/%s/thumb/%%"' % old_key,
|
monitor_db.action('UPDATE session_history_metadata SET grandparent_thumb = replace(grandparent_thumb, ?, ?) \
|
||||||
|
WHERE grandparent_thumb LIKE "/library/metadata/%s/thumb/%%"' % old_key,
|
||||||
[old_key, new_key])
|
[old_key, new_key])
|
||||||
|
|
||||||
# check art (1 table)
|
# check art (1 table)
|
||||||
monitor_db.action('UPDATE session_history_metadata SET art = replace(art, ?, ?) WHERE art LIKE "/library/metadata/%s/art/%%"' % old_key,
|
monitor_db.action('UPDATE session_history_metadata SET art = replace(art, ?, ?) \
|
||||||
|
WHERE art LIKE "/library/metadata/%s/art/%%"' % old_key,
|
||||||
[old_key, new_key])
|
[old_key, new_key])
|
||||||
|
|
||||||
#return 'Updated rating key in database.'
|
return 'Updated rating key in database.'
|
||||||
#else:
|
else:
|
||||||
#return 'No updated rating key needed in database. No changes were made.'
|
return 'No updated rating key needed in database. No changes were made.'
|
||||||
return mapping
|
# for debugging
|
||||||
|
#return mapping
|
Loading…
Add table
Add a link
Reference in a new issue