mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-10 23:42:37 -07:00
Beta Plex Cloud support
This commit is contained in:
parent
6c6493fe31
commit
83f1519932
4 changed files with 40 additions and 17 deletions
|
@ -528,9 +528,16 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
|
% if config['pms_is_cloud']:
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" id="monitor_pms_updates" name="monitor_pms_updates" value="1" disabled> Monitor Plex Updates
|
||||||
|
</label>
|
||||||
|
<span style="color: #eb8600; padding-left: 10px;"> Not available for Plex Cloud servers.</span>
|
||||||
|
% else:
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" id="monitor_pms_updates" name="monitor_pms_updates" value="1" ${config['monitor_pms_updates']}> Monitor Plex Updates
|
<input type="checkbox" id="monitor_pms_updates" name="monitor_pms_updates" value="1" ${config['monitor_pms_updates']}> Monitor Plex Updates
|
||||||
</label>
|
</label>
|
||||||
|
% endif
|
||||||
<p class="help-block">Enable to have Tautulli check if updates are available for the Plex Media Server.</p>
|
<p class="help-block">Enable to have Tautulli check if updates are available for the Plex Media Server.</p>
|
||||||
</div>
|
</div>
|
||||||
<div id="pms_update_options">
|
<div id="pms_update_options">
|
||||||
|
@ -552,10 +559,17 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
|
% if config['pms_is_cloud']:
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" id="monitor_remote_access" name="monitor_remote_access" value="1" disabled> Monitor Plex Remote Access
|
||||||
|
</label>
|
||||||
|
<span style="color: #eb8600; padding-left: 10px;"> Not available for Plex Cloud servers.</span>
|
||||||
|
% else:
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" id="monitor_remote_access" name="monitor_remote_access" value="1" ${config['monitor_remote_access']}> Monitor Plex Remote Access
|
<input type="checkbox" id="monitor_remote_access" name="monitor_remote_access" value="1" ${config['monitor_remote_access']}> Monitor Plex Remote Access
|
||||||
</label>
|
</label>
|
||||||
<span id="remoteAccessCheck" style="color: #eb8600; padding-left: 10px;"></span>
|
<span id="remoteAccessCheck" style="color: #eb8600; padding-left: 10px;"></span>
|
||||||
|
% endif
|
||||||
<p class="help-block">Enable to have Tautulli check if remote access to the Plex Media Server goes down.</p>
|
<p class="help-block">Enable to have Tautulli check if remote access to the Plex Media Server goes down.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -598,9 +612,16 @@
|
||||||
<p class="help-block">If you have secure connections enabled on your Plex Server, communicate with it securely.</p>
|
<p class="help-block">If you have secure connections enabled on your Plex Server, communicate with it securely.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
|
% if config['pms_is_cloud']:
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" id="pms_url_manual" name="pms_url_manual" value="1" disabled> Manual Connection
|
||||||
|
</label>
|
||||||
|
<span style="color: #eb8600; padding-left: 10px;"> Not available for Plex Cloud servers.</span>
|
||||||
|
% else:
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" id="pms_url_manual" name="pms_url_manual" value="1" ${config['pms_url_manual']}> Manual Connection
|
<input type="checkbox" id="pms_url_manual" name="pms_url_manual" value="1" ${config['pms_url_manual']}> Manual Connection
|
||||||
</label>
|
</label>
|
||||||
|
% endif
|
||||||
<p class="help-block">Use the user defined connection details. Do not retrieve the server connection URL automatically.</p>
|
<p class="help-block">Use the user defined connection details. Do not retrieve the server connection URL automatically.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
<form>
|
<form>
|
||||||
<div class="wizard-card" data-cardname="card1">
|
<div class="wizard-card" data-cardname="card1">
|
||||||
<div style="float: right;">
|
<div style="float: right;">
|
||||||
<img alt="Tautulli" src="${http_root}images/logo-tautulli-50.png" />
|
<object data="${http_root}images/logo-tautulli.svg" type="image/svg+xml" style="height: 45px;"></object>
|
||||||
</div>
|
</div>
|
||||||
<h3 style="line-height: 50px;">Welcome!</h3>
|
<h3 style="line-height: 50px;">Welcome!</h3>
|
||||||
<br />
|
<br />
|
||||||
|
@ -469,9 +469,9 @@
|
||||||
function getServerOptions(token) {
|
function getServerOptions(token) {
|
||||||
/* Set token and returns server options */
|
/* Set token and returns server options */
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "discover/" + token + '?include_cloud=false',
|
url: "discover/" + token,
|
||||||
success: function (result) {
|
success: function (result) {
|
||||||
$('#pms_ip').html("")
|
$('#pms_ip').html("");
|
||||||
// Add all servers to the "combobox"
|
// Add all servers to the "combobox"
|
||||||
$select_pms[0].selectize.addOption(result);
|
$select_pms[0].selectize.addOption(result);
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,18 +121,19 @@ class PlexTV(object):
|
||||||
self.timeout = plexpy.CONFIG.PMS_TIMEOUT
|
self.timeout = plexpy.CONFIG.PMS_TIMEOUT
|
||||||
self.ssl_verify = plexpy.CONFIG.VERIFY_SSL_CERT
|
self.ssl_verify = plexpy.CONFIG.VERIFY_SSL_CERT
|
||||||
|
|
||||||
if not self.token:
|
if self.username is None and self.password is None:
|
||||||
# Check if we should use the admin token, or the guest server token
|
if not self.token:
|
||||||
if session.get_session_user_id():
|
# Check if we should use the admin token, or the guest server token
|
||||||
user_data = users.Users()
|
if session.get_session_user_id():
|
||||||
user_tokens = user_data.get_tokens(user_id=session.get_session_user_id())
|
user_data = users.Users()
|
||||||
self.token = user_tokens['server_token']
|
user_tokens = user_data.get_tokens(user_id=session.get_session_user_id())
|
||||||
else:
|
self.token = user_tokens['server_token']
|
||||||
self.token = plexpy.CONFIG.PMS_TOKEN
|
else:
|
||||||
|
self.token = plexpy.CONFIG.PMS_TOKEN
|
||||||
|
|
||||||
if not self.token:
|
if not self.token:
|
||||||
logger.error(u"Tautulli PlexTV :: PlexTV called, but no token provided.")
|
logger.error(u"Tautulli PlexTV :: PlexTV called, but no token provided.")
|
||||||
return
|
return
|
||||||
|
|
||||||
self.request_handler = http_handler.HTTPHandler(urls=self.urls,
|
self.request_handler = http_handler.HTTPHandler(urls=self.urls,
|
||||||
token=self.token,
|
token=self.token,
|
||||||
|
@ -606,7 +607,8 @@ class PlexTV(object):
|
||||||
helpers.get_xml_attr(d, 'owned') == '1' and \
|
helpers.get_xml_attr(d, 'owned') == '1' and \
|
||||||
helpers.get_xml_attr(d, 'provides') == 'server':
|
helpers.get_xml_attr(d, 'provides') == 'server':
|
||||||
|
|
||||||
if not include_cloud and helpers.get_xml_attr(d, 'platform').lower() == 'cloud':
|
is_cloud = (helpers.get_xml_attr(d, 'platform').lower() == 'cloud')
|
||||||
|
if not include_cloud and is_cloud:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
connections = d.getElementsByTagName('Connection')
|
connections = d.getElementsByTagName('Connection')
|
||||||
|
@ -623,7 +625,7 @@ class PlexTV(object):
|
||||||
helpers.get_xml_attr(c, 'local') == '0':
|
helpers.get_xml_attr(c, 'local') == '0':
|
||||||
continue
|
continue
|
||||||
|
|
||||||
server = {'httpsRequired': helpers.get_xml_attr(d, 'httpsRequired'),
|
server = {'httpsRequired': '1' if is_cloud else helpers.get_xml_attr(d, 'httpsRequired'),
|
||||||
'clientIdentifier': helpers.get_xml_attr(d, 'clientIdentifier'),
|
'clientIdentifier': helpers.get_xml_attr(d, 'clientIdentifier'),
|
||||||
'label': helpers.get_xml_attr(d, 'name'),
|
'label': helpers.get_xml_attr(d, 'name'),
|
||||||
'ip': helpers.get_xml_attr(c, 'address'),
|
'ip': helpers.get_xml_attr(c, 'address'),
|
||||||
|
|
|
@ -148,7 +148,7 @@ class WebInterface(object):
|
||||||
plexpy.CONFIG.write()
|
plexpy.CONFIG.write()
|
||||||
|
|
||||||
include_cloud = not (include_cloud == 'false')
|
include_cloud = not (include_cloud == 'false')
|
||||||
all_servers = all_servers == 'true'
|
all_servers = (all_servers == 'true')
|
||||||
|
|
||||||
plex_tv = plextv.PlexTV()
|
plex_tv = plextv.PlexTV()
|
||||||
servers_list = plex_tv.discover(include_cloud=include_cloud,
|
servers_list = plex_tv.discover(include_cloud=include_cloud,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue