mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-15 01:32:57 -07:00
Update setup wizard
This commit is contained in:
parent
c586fe1d07
commit
abab2f3f6b
4 changed files with 136 additions and 157 deletions
|
@ -638,7 +638,7 @@ class PlexTV(object):
|
|||
|
||||
return server_times
|
||||
|
||||
def discover(self):
|
||||
def discover(self, include_cloud=True):
|
||||
""" Query plex for all servers online. Returns the ones you own in a selectize format """
|
||||
servers = self.get_plextv_resources(include_https=True, output_format='xml')
|
||||
clean_servers = []
|
||||
|
@ -661,6 +661,10 @@ class PlexTV(object):
|
|||
if helpers.get_xml_attr(d, 'presence') == '1' and \
|
||||
helpers.get_xml_attr(d, 'owned') == '1' and \
|
||||
helpers.get_xml_attr(d, 'provides') == 'server':
|
||||
|
||||
if not include_cloud and helpers.get_xml_attr(d, 'platform').lower() == 'cloud':
|
||||
continue
|
||||
|
||||
connections = d.getElementsByTagName('Connection')
|
||||
|
||||
for c in connections:
|
||||
|
|
|
@ -93,13 +93,13 @@ def refresh_libraries():
|
|||
plexpy.CONFIG.__setattr__('HOME_LIBRARY_CARDS', new_keys)
|
||||
plexpy.CONFIG.write()
|
||||
|
||||
if plexpy.CONFIG.UPDATE_SECTION_IDS == 1 or plexpy.CONFIG.UPDATE_SECTION_IDS == -1:
|
||||
# Start library section_id update on it's own thread
|
||||
threading.Thread(target=libraries.update_section_ids).start()
|
||||
#if plexpy.CONFIG.UPDATE_SECTION_IDS == 1 or plexpy.CONFIG.UPDATE_SECTION_IDS == -1:
|
||||
# # Start library section_id update on it's own thread
|
||||
# threading.Thread(target=libraries.update_section_ids).start()
|
||||
|
||||
if plexpy.CONFIG.UPDATE_LABELS == 1 or plexpy.CONFIG.UPDATE_LABELS == -1:
|
||||
# Start library labels update on it's own thread
|
||||
threading.Thread(target=libraries.update_labels).start()
|
||||
#if plexpy.CONFIG.UPDATE_LABELS == 1 or plexpy.CONFIG.UPDATE_LABELS == -1:
|
||||
# # Start library labels update on it's own thread
|
||||
# threading.Thread(target=libraries.update_labels).start()
|
||||
|
||||
logger.info(u"PlexPy Pmsconnect :: Libraries list refreshed.")
|
||||
return True
|
||||
|
|
|
@ -131,7 +131,7 @@ class WebInterface(object):
|
|||
@cherrypy.tools.json_out()
|
||||
@requireAuth(member_of("admin"))
|
||||
@addtoapi("get_server_list")
|
||||
def discover(self, token=None, **kwargs):
|
||||
def discover(self, token=None, include_cloud=True, **kwargs):
|
||||
""" Get all your servers that are published to Plex.tv.
|
||||
|
||||
```
|
||||
|
@ -161,8 +161,10 @@ class WebInterface(object):
|
|||
plexpy.CONFIG.__setattr__('PMS_TOKEN', token)
|
||||
plexpy.CONFIG.write()
|
||||
|
||||
include_cloud = not (include_cloud == 'false')
|
||||
|
||||
plex_tv = plextv.PlexTV()
|
||||
servers = plex_tv.discover()
|
||||
servers = plex_tv.discover(include_cloud=include_cloud)
|
||||
|
||||
if servers:
|
||||
return servers
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue