From 7cbc1993b244583186dd13176d8ac6701dbff41a Mon Sep 17 00:00:00 2001 From: Jonathan Wong Date: Tue, 20 Oct 2015 00:46:56 -0700 Subject: [PATCH] Clean up code --- data/interfaces/default/info.html | 56 ++++++++++++++----------------- plexpy/webserve.py | 2 +- 2 files changed, 27 insertions(+), 31 deletions(-) diff --git a/data/interfaces/default/info.html b/data/interfaces/default/info.html index 6de5b27f..5ab9f294 100644 --- a/data/interfaces/default/info.html +++ b/data/interfaces/default/info.html @@ -307,6 +307,13 @@ DOCUMENTATION :: END % endif % endif
+ % if data['type'] == 'library' and config['update_library_ids'] == 1: +
+ Updating library ids in the database. This could take a few minutes depending on the size of your database. +
+ The history table will refresh automatically when the update is complete. Please wait... +
+ % endif
Watch History for ${data['title']} @@ -409,21 +416,15 @@ DOCUMENTATION :: END
-
-
-

- Error retrieving item metadata. This media item is not available in the Plex Media Server library. -

- % if query: -

- If the item has been moved, please select the correct match below to update the PlexPy database. -

- % endif -
-
+
+ Error retrieving item metadata. This media item is not available in the Plex Media Server library. +
% if query: +
+ If the item has been moved, please select the correct match below to update the PlexPy database. +
Search Results for ${query['query_string']} @@ -502,24 +503,19 @@ DOCUMENTATION :: END 'library_id': "${data['library_id']}" }; } } - if ("${config['update_library_ids']}" == "1") { - $('#history_table').before('
\ - Updating library ids in the database. This could take a few minutes depending on the size of your database. \ -
\ - The history table will refresh automatically when complete. Please wait... \ -
') - $.ajax({ - url: 'update_library_ids', - type: 'post', - cache: false, - async: true, - data: { }, - complete: function (xhr, status) { - $('#update_mssage').remove(); - history_table.draw(); - } - }); - } + } + if ("${config['update_library_ids']}" == "1") { + $.ajax({ + url: 'update_library_ids', + type: 'post', + cache: false, + async: true, + data: { }, + complete: function (xhr, status) { + $('#update_library_ids_mssage').remove(); + history_table.draw(); + } + }); } % elif data['type'] == 'show' or data['type'] == 'artist': diff --git a/plexpy/webserve.py b/plexpy/webserve.py index 7b5896bb..a6a16ac3 100644 --- a/plexpy/webserve.py +++ b/plexpy/webserve.py @@ -1481,9 +1481,9 @@ class WebInterface(object): result = data_factory.update_library_ids() if result: + logger.debug(u"Updated all library_id's in database.") 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.")