mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-24 06:55:26 -07:00
Update library_id from top level info page
* Calls update first time loading the page
This commit is contained in:
parent
aaacfb5bf9
commit
fc43f4773a
4 changed files with 37 additions and 10 deletions
|
@ -502,6 +502,24 @@ DOCUMENTATION :: END
|
||||||
'library_id': "${data['library_id']}" };
|
'library_id': "${data['library_id']}" };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ("${config['update_library_ids']}" == "1") {
|
||||||
|
$('#history_table').before('<div id="update_mssage" style="text-align: center"> \
|
||||||
|
<i class="fa fa-refresh fa-spin"></i> Updating library ids in the database. This could take a few minutes depending on the size of your database. \
|
||||||
|
<br /> \
|
||||||
|
The history table will refresh automatically when complete. Please wait... \
|
||||||
|
</div>')
|
||||||
|
$.ajax({
|
||||||
|
url: 'update_library_ids',
|
||||||
|
type: 'post',
|
||||||
|
cache: false,
|
||||||
|
async: true,
|
||||||
|
data: { },
|
||||||
|
complete: function (xhr, status) {
|
||||||
|
$('#update_mssage').remove();
|
||||||
|
history_table.draw();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
% elif data['type'] == 'show' or data['type'] == 'artist':
|
% elif data['type'] == 'show' or data['type'] == 'artist':
|
||||||
|
|
|
@ -609,15 +609,6 @@ def dbcheck():
|
||||||
c_db.execute(
|
c_db.execute(
|
||||||
'ALTER TABLE session_history_metadata ADD COLUMN library_title TEXT'
|
'ALTER TABLE session_history_metadata ADD COLUMN library_title TEXT'
|
||||||
)
|
)
|
||||||
logger.debug(u"Updating library_id's in database. Please wait...")
|
|
||||||
from plexpy import datafactory
|
|
||||||
data_factory = datafactory.DataFactory()
|
|
||||||
result = data_factory.update_library_ids()
|
|
||||||
|
|
||||||
if result:
|
|
||||||
logger.debug(u"Updated all library_id's in database.")
|
|
||||||
else:
|
|
||||||
logger.debug(u"Unable to update library_id's in database.")
|
|
||||||
|
|
||||||
# Upgrade users table from earlier versions
|
# Upgrade users table from earlier versions
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -210,6 +210,7 @@ _CONFIG_DEFINITIONS = {
|
||||||
'TWITTER_ON_BUFFER': (int, 'Twitter', 0),
|
'TWITTER_ON_BUFFER': (int, 'Twitter', 0),
|
||||||
'TWITTER_ON_WATCHED': (int, 'Twitter', 0),
|
'TWITTER_ON_WATCHED': (int, 'Twitter', 0),
|
||||||
'UPDATE_DB_INTERVAL': (int, 'General', 24),
|
'UPDATE_DB_INTERVAL': (int, 'General', 24),
|
||||||
|
'UPDATE_LIBRARY_IDS': (int, 'General', 1),
|
||||||
'VERIFY_SSL_CERT': (bool_int, 'Advanced', 1),
|
'VERIFY_SSL_CERT': (bool_int, 'Advanced', 1),
|
||||||
'VIDEO_LOGGING_ENABLE': (int, 'Monitoring', 1),
|
'VIDEO_LOGGING_ENABLE': (int, 'Monitoring', 1),
|
||||||
'XBMC_ENABLED': (int, 'XBMC', 0),
|
'XBMC_ENABLED': (int, 'XBMC', 0),
|
||||||
|
|
|
@ -774,7 +774,8 @@ class WebInterface(object):
|
||||||
query = None
|
query = None
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
"pms_identifier": plexpy.CONFIG.PMS_IDENTIFIER
|
"pms_identifier": plexpy.CONFIG.PMS_IDENTIFIER,
|
||||||
|
"update_library_ids": plexpy.CONFIG.UPDATE_LIBRARY_IDS
|
||||||
}
|
}
|
||||||
|
|
||||||
if source == 'history':
|
if source == 'history':
|
||||||
|
@ -1471,3 +1472,19 @@ class WebInterface(object):
|
||||||
if servers:
|
if servers:
|
||||||
cherrypy.response.headers['Content-type'] = 'application/json'
|
cherrypy.response.headers['Content-type'] = 'application/json'
|
||||||
return servers
|
return servers
|
||||||
|
|
||||||
|
@cherrypy.expose
|
||||||
|
def update_library_ids(self, **kwargs):
|
||||||
|
|
||||||
|
logger.debug(u"Updating library_id's in database.")
|
||||||
|
data_factory = datafactory.DataFactory()
|
||||||
|
result = data_factory.update_library_ids()
|
||||||
|
|
||||||
|
if result:
|
||||||
|
plexpy.CONFIG.UPDATE_LIBRARY_IDS = 0
|
||||||
|
plexpy.CONFIG.write()
|
||||||
|
logger.debug(u"Updated all library_id's in database.")
|
||||||
|
return "Library ids updated."
|
||||||
|
else:
|
||||||
|
logger.debug(u"Unable to update library_id's in database.")
|
||||||
|
return "Unable to update library ids in database."
|
Loading…
Add table
Add a link
Reference in a new issue