mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-15 01:32:57 -07:00
Use server_id when retrieving library details
This commit is contained in:
parent
976154ed6c
commit
ecfc3ed74f
1 changed files with 9 additions and 6 deletions
|
@ -739,7 +739,7 @@ class Libraries(object):
|
|||
except Exception as e:
|
||||
logger.warn(u"Tautulli Libraries :: Unable to execute database query for set_config: %s." % e)
|
||||
|
||||
def get_details(self, section_id=None):
|
||||
def get_details(self, section_id=None, server_id=None):
|
||||
default_return = {'row_id': 0,
|
||||
'server_id': '',
|
||||
'section_id': 0,
|
||||
|
@ -760,7 +760,10 @@ class Libraries(object):
|
|||
if not section_id:
|
||||
return default_return
|
||||
|
||||
def get_library_details(section_id=section_id):
|
||||
if server_id is None:
|
||||
server_id = plexpy.CONFIG.PMS_IDENTIFIER
|
||||
|
||||
def get_library_details(section_id=section_id, server_id=server_id):
|
||||
monitor_db = database.MonitorDatabase()
|
||||
|
||||
try:
|
||||
|
@ -771,8 +774,8 @@ class Libraries(object):
|
|||
'custom_art_url AS custom_art, is_active, ' \
|
||||
'do_notify, do_notify_created, keep_history, deleted_section ' \
|
||||
'FROM library_sections ' \
|
||||
'WHERE section_id = ? '
|
||||
result = monitor_db.select(query, args=[section_id])
|
||||
'WHERE section_id = ? AND server_id = ? '
|
||||
result = monitor_db.select(query, args=[section_id, server_id])
|
||||
else:
|
||||
result = []
|
||||
except Exception as e:
|
||||
|
@ -812,7 +815,7 @@ class Libraries(object):
|
|||
}
|
||||
return library_details
|
||||
|
||||
library_details = get_library_details(section_id=section_id)
|
||||
library_details = get_library_details(section_id=section_id, server_id=server_id)
|
||||
|
||||
if library_details:
|
||||
return library_details
|
||||
|
@ -823,7 +826,7 @@ class Libraries(object):
|
|||
# Let's first refresh the libraries list to make sure the library isn't newly added and not in the db yet
|
||||
refresh_libraries()
|
||||
|
||||
library_details = get_library_details(section_id=section_id)
|
||||
library_details = get_library_details(section_id=section_id, server_id=server_id)
|
||||
|
||||
if library_details:
|
||||
return library_details
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue