mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-08 14:10:52 -07:00
More template filters for Libraries, Users, and Sync
This commit is contained in:
parent
4f8a5211f8
commit
89694b5069
13 changed files with 74 additions and 43 deletions
|
@ -341,6 +341,7 @@ DOCUMENTATION :: END
|
||||||
</div>
|
</div>
|
||||||
<div class="button-bar">
|
<div class="button-bar">
|
||||||
<div class="colvis-button-bar hidden-xs"></div>
|
<div class="colvis-button-bar hidden-xs"></div>
|
||||||
|
% if _session['user_group'] == 'admin':
|
||||||
<button class="btn btn-danger btn-edit" data-toggle="button" aria-pressed="false" autocomplete="off" id="row-edit-mode">
|
<button class="btn btn-danger btn-edit" data-toggle="button" aria-pressed="false" autocomplete="off" id="row-edit-mode">
|
||||||
<i class="fa fa-trash-o"></i> Delete mode
|
<i class="fa fa-trash-o"></i> Delete mode
|
||||||
</button>
|
</button>
|
||||||
|
@ -361,6 +362,7 @@ DOCUMENTATION :: END
|
||||||
</span>
|
</span>
|
||||||
% endif
|
% endif
|
||||||
<div class="alert alert-danger alert-edit" role="alert" id="row-edit-mode-alert"><i class="fa fa-exclamation-triangle"></i> Select rows to delete. Data is deleted upon exiting delete mode.</div>
|
<div class="alert alert-danger alert-edit" role="alert" id="row-edit-mode-alert"><i class="fa fa-exclamation-triangle"></i> Select rows to delete. Data is deleted upon exiting delete mode.</div>
|
||||||
|
% endif
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-card-back">
|
<div class="table-card-back">
|
||||||
|
@ -434,7 +436,8 @@ DOCUMENTATION :: END
|
||||||
data: function ( d ) {
|
data: function ( d ) {
|
||||||
return {
|
return {
|
||||||
json_data: JSON.stringify( d ),
|
json_data: JSON.stringify( d ),
|
||||||
grandparent_rating_key: "${data['rating_key']}"
|
grandparent_rating_key: "${data['rating_key']}",
|
||||||
|
user_id: "${_session['user_id']}" == "None" ? null : "${_session['user_id']}"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -449,7 +452,8 @@ DOCUMENTATION :: END
|
||||||
data: function ( d ) {
|
data: function ( d ) {
|
||||||
return {
|
return {
|
||||||
json_data: JSON.stringify( d ),
|
json_data: JSON.stringify( d ),
|
||||||
parent_rating_key: "${data['rating_key']}"
|
parent_rating_key: "${data['rating_key']}",
|
||||||
|
user_id: "${_session['user_id']}" == "None" ? null : "${_session['user_id']}"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -464,7 +468,8 @@ DOCUMENTATION :: END
|
||||||
data: function ( d ) {
|
data: function ( d ) {
|
||||||
return {
|
return {
|
||||||
json_data: JSON.stringify( d ),
|
json_data: JSON.stringify( d ),
|
||||||
rating_key: "${data['rating_key']}"
|
rating_key: "${data['rating_key']}",
|
||||||
|
user_id: "${_session['user_id']}" == "None" ? null : "${_session['user_id']}"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="button-bar">
|
<div class="button-bar">
|
||||||
<div class="colvis-button-bar hidden-xs"></div>
|
<div class="colvis-button-bar hidden-xs"></div>
|
||||||
|
% if _session['user_group'] == 'admin':
|
||||||
% if config['update_section_ids'] == -1:
|
% if config['update_section_ids'] == -1:
|
||||||
<button class="btn btn-dark refresh-libraries-button" id="refresh-libraries-list" disabled><i class="fa fa-refresh"></i> Refresh libraries</button>
|
<button class="btn btn-dark refresh-libraries-button" id="refresh-libraries-list" disabled><i class="fa fa-refresh"></i> Refresh libraries</button>
|
||||||
% else:
|
% else:
|
||||||
|
@ -34,6 +35,7 @@
|
||||||
<i class="fa fa-pencil"></i> Edit mode
|
<i class="fa fa-pencil"></i> Edit mode
|
||||||
</button> 
|
</button> 
|
||||||
<div class="alert alert-danger alert-edit" role="alert" id="row-edit-mode-alert"><i class="fa fa-exclamation-triangle"></i> Select libraries to delete/purge. Data is deleted/purged upon exiting edit mode.</div>
|
<div class="alert alert-danger alert-edit" role="alert" id="row-edit-mode-alert"><i class="fa fa-exclamation-triangle"></i> Select libraries to delete/purge. Data is deleted/purged upon exiting edit mode.</div>
|
||||||
|
% endif
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class='table-card-back'>
|
<div class='table-card-back'>
|
||||||
|
|
|
@ -61,9 +61,11 @@ DOCUMENTATION :: END
|
||||||
% endif
|
% endif
|
||||||
<div class="user-info-username">
|
<div class="user-info-username">
|
||||||
<span class="set-username">${data['section_name']}</span>
|
<span class="set-username">${data['section_name']}</span>
|
||||||
|
% if _session['user_group'] == 'admin':
|
||||||
<span id="edit-library-tooltip" data-target="tooltip" title="Edit library details">
|
<span id="edit-library-tooltip" data-target="tooltip" title="Edit library details">
|
||||||
<a href="#" data-toggle="modal" data-target="#edit-library-modal" id="toggle-edit-library-modal"><i class="fa fa-pencil"></i></a>
|
<a href="#" data-toggle="modal" data-target="#edit-library-modal" id="toggle-edit-library-modal"><i class="fa fa-pencil"></i></a>
|
||||||
</span>
|
</span>
|
||||||
|
% endif
|
||||||
</div>
|
</div>
|
||||||
<div class="user-info-nav">
|
<div class="user-info-nav">
|
||||||
<ul class="user-info-nav">
|
<ul class="user-info-nav">
|
||||||
|
@ -232,6 +234,7 @@ DOCUMENTATION :: END
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="button-bar">
|
<div class="button-bar">
|
||||||
|
% if _session['user_group'] == 'admin':
|
||||||
% if config['get_file_sizes'] and data['section_id'] in config['get_file_sizes_hold']['section_ids']:
|
% if config['get_file_sizes'] and data['section_id'] in config['get_file_sizes_hold']['section_ids']:
|
||||||
<button class="btn btn-dark refresh-media-info-table-button" id="refresh-media-info-table" style="margin-right: 5px;" disabled>
|
<button class="btn btn-dark refresh-media-info-table-button" id="refresh-media-info-table" style="margin-right: 5px;" disabled>
|
||||||
<i class="fa fa-refresh"></i> Refresh media info
|
<i class="fa fa-refresh"></i> Refresh media info
|
||||||
|
@ -241,6 +244,7 @@ DOCUMENTATION :: END
|
||||||
<i class="fa fa-refresh"></i> Refresh media info
|
<i class="fa fa-refresh"></i> Refresh media info
|
||||||
</button>
|
</button>
|
||||||
% endif
|
% endif
|
||||||
|
% endif
|
||||||
<div class="colvis-button-bar hidden-xs" id="button-bar-media-info"></div>
|
<div class="colvis-button-bar hidden-xs" id="button-bar-media-info"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -376,7 +380,8 @@ DOCUMENTATION :: END
|
||||||
data: function ( d ) {
|
data: function ( d ) {
|
||||||
return {
|
return {
|
||||||
json_data: JSON.stringify( d ),
|
json_data: JSON.stringify( d ),
|
||||||
section_id: section_id
|
section_id: section_id,
|
||||||
|
user_id: "${_session['user_id']}" == "None" ? null : "${_session['user_id']}"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,10 @@
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
sync_table_options.ajax = {
|
sync_table_options.ajax = {
|
||||||
url: 'get_sync'
|
url: 'get_sync',
|
||||||
|
data: function (d) {
|
||||||
|
d.user_id = "${_session['user_id']}" == "None" ? null : "${_session['user_id']}"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
sync_table = $('#sync_table').DataTable(sync_table_options);
|
sync_table = $('#sync_table').DataTable(sync_table_options);
|
||||||
var colvis = new $.fn.dataTable.ColVis( sync_table, { buttonText: '<i class="fa fa-columns"></i> Select columns', buttonClass: 'btn btn-dark' } );
|
var colvis = new $.fn.dataTable.ColVis( sync_table, { buttonText: '<i class="fa fa-columns"></i> Select columns', buttonClass: 'btn btn-dark' } );
|
||||||
|
|
|
@ -54,9 +54,11 @@ from plexpy import helpers
|
||||||
<div class="user-info-poster-face" style="background-image: url(${data['user_thumb']});"></div>
|
<div class="user-info-poster-face" style="background-image: url(${data['user_thumb']});"></div>
|
||||||
<div class="user-info-username">
|
<div class="user-info-username">
|
||||||
<span class="set-username">${data['friendly_name']}</span>
|
<span class="set-username">${data['friendly_name']}</span>
|
||||||
|
% if _session['user_group'] == 'admin':
|
||||||
<span id="edit-user-tooltip" data-target="tooltip" title="Edit user details">
|
<span id="edit-user-tooltip" data-target="tooltip" title="Edit user details">
|
||||||
<a href="#" data-toggle="modal" data-target="#edit-user-modal" id="toggle-edit-user-modal"><i class="fa fa-pencil"></i></a>
|
<a href="#" data-toggle="modal" data-target="#edit-user-modal" id="toggle-edit-user-modal"><i class="fa fa-pencil"></i></a>
|
||||||
</span>
|
</span>
|
||||||
|
% endif
|
||||||
</div>
|
</div>
|
||||||
<div class="user-info-nav">
|
<div class="user-info-nav">
|
||||||
<ul class="user-info-nav">
|
<ul class="user-info-nav">
|
||||||
|
@ -179,10 +181,12 @@ from plexpy import helpers
|
||||||
</div>
|
</div>
|
||||||
<div class="button-bar">
|
<div class="button-bar">
|
||||||
<div class="colvis-button-bar hidden-xs" id="button-bar-history"></div>
|
<div class="colvis-button-bar hidden-xs" id="button-bar-history"></div>
|
||||||
|
% if _session['user_group'] == 'admin':
|
||||||
<button class="btn btn-danger btn-edit" data-toggle="button" aria-pressed="false" autocomplete="off" id="row-edit-mode">
|
<button class="btn btn-danger btn-edit" data-toggle="button" aria-pressed="false" autocomplete="off" id="row-edit-mode">
|
||||||
<i class="fa fa-trash-o"></i> Delete mode
|
<i class="fa fa-trash-o"></i> Delete mode
|
||||||
</button>
|
</button>
|
||||||
<div class="alert alert-danger alert-edit" role="alert" id="row-edit-mode-alert"><i class="fa fa-exclamation-triangle"></i> Select rows to delete. Data is deleted upon exiting delete mode.</div>
|
<div class="alert alert-danger alert-edit" role="alert" id="row-edit-mode-alert"><i class="fa fa-exclamation-triangle"></i> Select rows to delete. Data is deleted upon exiting delete mode.</div>
|
||||||
|
% endif
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-card-back">
|
<div class="table-card-back">
|
||||||
|
|
|
@ -14,11 +14,13 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="button-bar">
|
<div class="button-bar">
|
||||||
<div class="colvis-button-bar hidden-xs"></div>
|
<div class="colvis-button-bar hidden-xs"></div>
|
||||||
|
% if _session['user_group'] == 'admin':
|
||||||
<button class="btn btn-dark refresh-users-button" id="refresh-users-list"><i class="fa fa-refresh"></i> Refresh users</button>
|
<button class="btn btn-dark refresh-users-button" id="refresh-users-list"><i class="fa fa-refresh"></i> Refresh users</button>
|
||||||
<button class="btn btn-danger btn-edit" data-toggle="button" aria-pressed="false" autocomplete="off" id="row-edit-mode">
|
<button class="btn btn-danger btn-edit" data-toggle="button" aria-pressed="false" autocomplete="off" id="row-edit-mode">
|
||||||
<i class="fa fa-pencil"></i> Edit mode
|
<i class="fa fa-pencil"></i> Edit mode
|
||||||
</button> 
|
</button> 
|
||||||
<div class="alert alert-danger alert-edit" role="alert" id="row-edit-mode-alert"><i class="fa fa-exclamation-triangle"></i> Select users to delete/purge. Data is deleted/purged upon exiting edit mode.</div>
|
<div class="alert alert-danger alert-edit" role="alert" id="row-edit-mode-alert"><i class="fa fa-exclamation-triangle"></i> Select users to delete/purge. Data is deleted/purged upon exiting edit mode.</div>
|
||||||
|
% endif
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class='table-card-back'>
|
<div class='table-card-back'>
|
||||||
|
|
|
@ -148,7 +148,7 @@ class DataFactory(object):
|
||||||
|
|
||||||
dict = {'recordsFiltered': query['filteredCount'],
|
dict = {'recordsFiltered': query['filteredCount'],
|
||||||
'recordsTotal': query['totalCount'],
|
'recordsTotal': query['totalCount'],
|
||||||
'data': rows,
|
'data': helpers.filter_datatable_session(rows),
|
||||||
'draw': query['draw'],
|
'draw': query['draw'],
|
||||||
'filter_duration': helpers.human_duration(filter_duration, sig='dhm'),
|
'filter_duration': helpers.human_duration(filter_duration, sig='dhm'),
|
||||||
'total_duration': helpers.human_duration(total_duration, sig='dhm')
|
'total_duration': helpers.human_duration(total_duration, sig='dhm')
|
||||||
|
@ -470,7 +470,7 @@ class DataFactory(object):
|
||||||
|
|
||||||
home_stats.append({'stat_id': stat,
|
home_stats.append({'stat_id': stat,
|
||||||
'stat_type': sort_type,
|
'stat_type': sort_type,
|
||||||
'rows': top_users})
|
'rows': helpers.filter_datatable_session(top_users)})
|
||||||
|
|
||||||
elif stat == 'top_platforms':
|
elif stat == 'top_platforms':
|
||||||
top_platform = []
|
top_platform = []
|
||||||
|
@ -567,7 +567,7 @@ class DataFactory(object):
|
||||||
last_watched.append(row)
|
last_watched.append(row)
|
||||||
|
|
||||||
home_stats.append({'stat_id': stat,
|
home_stats.append({'stat_id': stat,
|
||||||
'rows': last_watched})
|
'rows': helpers.filter_datatable_session(last_watched)})
|
||||||
|
|
||||||
elif stat == 'most_concurrent':
|
elif stat == 'most_concurrent':
|
||||||
|
|
||||||
|
|
|
@ -563,3 +563,17 @@ def uploadToImgur(imgPath, imgTitle=''):
|
||||||
logger.warn(u"PlexPy Helpers :: Unable to upload image to Imgur: %s" % e)
|
logger.warn(u"PlexPy Helpers :: Unable to upload image to Imgur: %s" % e)
|
||||||
|
|
||||||
return img_url
|
return img_url
|
||||||
|
|
||||||
|
def filter_datatable_session(list_of_dicts):
|
||||||
|
import cherrypy
|
||||||
|
from plexpy.webauth import SESSION_KEY
|
||||||
|
|
||||||
|
_cp_session = cherrypy.session.get(SESSION_KEY)
|
||||||
|
_session = {}
|
||||||
|
_session['username'], _session['user_id'], _session['user_group'], _session['expiry'] = \
|
||||||
|
_cp_session if _cp_session else (None, None, None, None)
|
||||||
|
|
||||||
|
if _session['user_id']:
|
||||||
|
return [d for d in list_of_dicts if str(d.get('user_id')) == str(_session['user_id'])]
|
||||||
|
else:
|
||||||
|
return list_of_dicts
|
|
@ -700,7 +700,7 @@ class Libraries(object):
|
||||||
}
|
}
|
||||||
user_stats.append(row)
|
user_stats.append(row)
|
||||||
|
|
||||||
return user_stats
|
return helpers.filter_datatable_session(user_stats)
|
||||||
|
|
||||||
def get_recently_watched(self, section_id=None, limit='10'):
|
def get_recently_watched(self, section_id=None, limit='10'):
|
||||||
monitor_db = database.MonitorDatabase()
|
monitor_db = database.MonitorDatabase()
|
||||||
|
|
|
@ -401,7 +401,7 @@ class PlexTV(object):
|
||||||
|
|
||||||
synced_items.append(sync_details)
|
synced_items.append(sync_details)
|
||||||
|
|
||||||
return synced_items
|
return helpers.filter_datatable_session(synced_items)
|
||||||
|
|
||||||
def get_server_urls(self, include_https=True):
|
def get_server_urls(self, include_https=True):
|
||||||
|
|
||||||
|
|
|
@ -190,7 +190,7 @@ class Users(object):
|
||||||
|
|
||||||
dict = {'recordsFiltered': query['filteredCount'],
|
dict = {'recordsFiltered': query['filteredCount'],
|
||||||
'recordsTotal': query['totalCount'],
|
'recordsTotal': query['totalCount'],
|
||||||
'data': rows,
|
'data': helpers.filter_datatable_session(rows),
|
||||||
'draw': query['draw']
|
'draw': query['draw']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -276,14 +276,15 @@ class Users(object):
|
||||||
'media_index': item['media_index'],
|
'media_index': item['media_index'],
|
||||||
'parent_media_index': item['parent_media_index'],
|
'parent_media_index': item['parent_media_index'],
|
||||||
'transcode_decision': item['transcode_decision'],
|
'transcode_decision': item['transcode_decision'],
|
||||||
'friendly_name': item['friendly_name']
|
'friendly_name': item['friendly_name'],
|
||||||
|
'user_id': item['custom_user_id']
|
||||||
}
|
}
|
||||||
|
|
||||||
rows.append(row)
|
rows.append(row)
|
||||||
|
|
||||||
dict = {'recordsFiltered': query['filteredCount'],
|
dict = {'recordsFiltered': query['filteredCount'],
|
||||||
'recordsTotal': query['totalCount'],
|
'recordsTotal': query['totalCount'],
|
||||||
'data': rows,
|
'data': helpers.filter_datatable_session(rows),
|
||||||
'draw': query['draw']
|
'draw': query['draw']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ def check_auth(*args, **kwargs):
|
||||||
for condition in conditions:
|
for condition in conditions:
|
||||||
# A condition is just a callable that returns true or false
|
# A condition is just a callable that returns true or false
|
||||||
if not condition():
|
if not condition():
|
||||||
raise cherrypy.HTTPRedirect("auth/login")
|
raise cherrypy.HTTPRedirect(plexpy.HTTP_ROOT)
|
||||||
else:
|
else:
|
||||||
raise cherrypy.HTTPRedirect("auth/login")
|
raise cherrypy.HTTPRedirect("auth/login")
|
||||||
|
|
||||||
|
|
|
@ -286,7 +286,7 @@ class WebInterface(object):
|
||||||
##### Libraries #####
|
##### Libraries #####
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth()
|
||||||
def libraries(self):
|
def libraries(self):
|
||||||
config = {
|
config = {
|
||||||
"update_section_ids": plexpy.CONFIG.UPDATE_SECTION_IDS
|
"update_section_ids": plexpy.CONFIG.UPDATE_SECTION_IDS
|
||||||
|
@ -295,7 +295,7 @@ class WebInterface(object):
|
||||||
return serve_template(templatename="libraries.html", title="Libraries", config=config)
|
return serve_template(templatename="libraries.html", title="Libraries", config=config)
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth()
|
||||||
@addtoapi()
|
@addtoapi()
|
||||||
def get_library_list(self, **kwargs):
|
def get_library_list(self, **kwargs):
|
||||||
|
|
||||||
|
@ -340,7 +340,7 @@ class WebInterface(object):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth()
|
||||||
def library(self, section_id=None):
|
def library(self, section_id=None):
|
||||||
config = {
|
config = {
|
||||||
"get_file_sizes": plexpy.CONFIG.GET_FILE_SIZES,
|
"get_file_sizes": plexpy.CONFIG.GET_FILE_SIZES,
|
||||||
|
@ -398,7 +398,7 @@ class WebInterface(object):
|
||||||
return status_message
|
return status_message
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth()
|
||||||
def get_library_watch_time_stats(self, section_id=None, **kwargs):
|
def get_library_watch_time_stats(self, section_id=None, **kwargs):
|
||||||
if section_id:
|
if section_id:
|
||||||
library_data = libraries.Libraries()
|
library_data = libraries.Libraries()
|
||||||
|
@ -413,7 +413,7 @@ class WebInterface(object):
|
||||||
return serve_template(templatename="user_watch_time_stats.html", data=None, title="Watch Stats")
|
return serve_template(templatename="user_watch_time_stats.html", data=None, title="Watch Stats")
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth()
|
||||||
def get_library_user_stats(self, section_id=None, **kwargs):
|
def get_library_user_stats(self, section_id=None, **kwargs):
|
||||||
if section_id:
|
if section_id:
|
||||||
library_data = libraries.Libraries()
|
library_data = libraries.Libraries()
|
||||||
|
@ -428,7 +428,7 @@ class WebInterface(object):
|
||||||
return serve_template(templatename="library_user_stats.html", data=None, title="Player Stats")
|
return serve_template(templatename="library_user_stats.html", data=None, title="Player Stats")
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth()
|
||||||
def get_library_recently_watched(self, section_id=None, limit='10', **kwargs):
|
def get_library_recently_watched(self, section_id=None, limit='10', **kwargs):
|
||||||
if section_id:
|
if section_id:
|
||||||
library_data = libraries.Libraries()
|
library_data = libraries.Libraries()
|
||||||
|
@ -443,7 +443,7 @@ class WebInterface(object):
|
||||||
return serve_template(templatename="user_recently_watched.html", data=None, title="Recently Watched")
|
return serve_template(templatename="user_recently_watched.html", data=None, title="Recently Watched")
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth()
|
||||||
def get_library_recently_added(self, section_id=None, limit='10', **kwargs):
|
def get_library_recently_added(self, section_id=None, limit='10', **kwargs):
|
||||||
if section_id:
|
if section_id:
|
||||||
pms_connect = pmsconnect.PmsConnect()
|
pms_connect = pmsconnect.PmsConnect()
|
||||||
|
@ -458,7 +458,7 @@ class WebInterface(object):
|
||||||
return serve_template(templatename="library_recently_added.html", data=None, title="Recently Added")
|
return serve_template(templatename="library_recently_added.html", data=None, title="Recently Added")
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth()
|
||||||
@addtoapi()
|
@addtoapi()
|
||||||
def get_library_media_info(self, section_id=None, section_type=None, rating_key=None, refresh='', **kwargs):
|
def get_library_media_info(self, section_id=None, section_type=None, rating_key=None, refresh='', **kwargs):
|
||||||
|
|
||||||
|
@ -613,12 +613,12 @@ class WebInterface(object):
|
||||||
##### Users #####
|
##### Users #####
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth()
|
||||||
def users(self):
|
def users(self):
|
||||||
return serve_template(templatename="users.html", title="Users")
|
return serve_template(templatename="users.html", title="Users")
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth()
|
||||||
@addtoapi()
|
@addtoapi()
|
||||||
def get_user_list(self, **kwargs):
|
def get_user_list(self, **kwargs):
|
||||||
|
|
||||||
|
@ -638,7 +638,7 @@ class WebInterface(object):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth()
|
||||||
def user(self, user_id=None):
|
def user(self, user_id=None):
|
||||||
user_data = users.Users()
|
user_data = users.Users()
|
||||||
if user_id:
|
if user_id:
|
||||||
|
@ -691,7 +691,7 @@ class WebInterface(object):
|
||||||
return status_message
|
return status_message
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth()
|
||||||
def get_user_watch_time_stats(self, user=None, user_id=None, **kwargs):
|
def get_user_watch_time_stats(self, user=None, user_id=None, **kwargs):
|
||||||
if user_id or user:
|
if user_id or user:
|
||||||
user_data = users.Users()
|
user_data = users.Users()
|
||||||
|
@ -706,7 +706,7 @@ class WebInterface(object):
|
||||||
return serve_template(templatename="user_watch_time_stats.html", data=None, title="Watch Stats")
|
return serve_template(templatename="user_watch_time_stats.html", data=None, title="Watch Stats")
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth()
|
||||||
def get_user_player_stats(self, user=None, user_id=None, **kwargs):
|
def get_user_player_stats(self, user=None, user_id=None, **kwargs):
|
||||||
if user_id or user:
|
if user_id or user:
|
||||||
user_data = users.Users()
|
user_data = users.Users()
|
||||||
|
@ -721,7 +721,7 @@ class WebInterface(object):
|
||||||
return serve_template(templatename="user_player_stats.html", data=None, title="Player Stats")
|
return serve_template(templatename="user_player_stats.html", data=None, title="Player Stats")
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth()
|
||||||
def get_user_recently_watched(self, user=None, user_id=None, limit='10', **kwargs):
|
def get_user_recently_watched(self, user=None, user_id=None, limit='10', **kwargs):
|
||||||
if user_id or user:
|
if user_id or user:
|
||||||
user_data = users.Users()
|
user_data = users.Users()
|
||||||
|
@ -736,7 +736,7 @@ class WebInterface(object):
|
||||||
return serve_template(templatename="user_recently_watched.html", data=None, title="Recently Watched")
|
return serve_template(templatename="user_recently_watched.html", data=None, title="Recently Watched")
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth()
|
||||||
def get_user_ips(self, user_id=None, **kwargs):
|
def get_user_ips(self, user_id=None, **kwargs):
|
||||||
|
|
||||||
user_data = users.Users()
|
user_data = users.Users()
|
||||||
|
@ -1094,12 +1094,12 @@ class WebInterface(object):
|
||||||
##### Sync #####
|
##### Sync #####
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth()
|
||||||
def sync(self):
|
def sync(self):
|
||||||
return serve_template(templatename="sync.html", title="Synced Items")
|
return serve_template(templatename="sync.html", title="Synced Items")
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth()
|
||||||
def get_sync(self, machine_id=None, user_id=None, **kwargs):
|
def get_sync(self, machine_id=None, user_id=None, **kwargs):
|
||||||
|
|
||||||
if not machine_id:
|
if not machine_id:
|
||||||
|
@ -1226,7 +1226,7 @@ class WebInterface(object):
|
||||||
raise cherrypy.HTTPRedirect("logs")
|
raise cherrypy.HTTPRedirect("logs")
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth()
|
||||||
def log_js_errors(self, page, message, file, line):
|
def log_js_errors(self, page, message, file, line):
|
||||||
""" Logs javascript errors from the web interface. """
|
""" Logs javascript errors from the web interface. """
|
||||||
logger.error(u"WebUI :: /%s : %s. (%s:%s)" % (page.rpartition('/')[-1],
|
logger.error(u"WebUI :: /%s : %s. (%s:%s)" % (page.rpartition('/')[-1],
|
||||||
|
@ -1812,7 +1812,7 @@ class WebInterface(object):
|
||||||
##### Info #####
|
##### Info #####
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth()
|
||||||
def info(self, rating_key=None, source=None, query=None, **kwargs):
|
def info(self, rating_key=None, source=None, query=None, **kwargs):
|
||||||
metadata = None
|
metadata = None
|
||||||
|
|
||||||
|
@ -1840,7 +1840,7 @@ class WebInterface(object):
|
||||||
return self.update_metadata(rating_key, query)
|
return self.update_metadata(rating_key, query)
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth()
|
||||||
def get_item_children(self, rating_key='', **kwargs):
|
def get_item_children(self, rating_key='', **kwargs):
|
||||||
|
|
||||||
pms_connect = pmsconnect.PmsConnect()
|
pms_connect = pmsconnect.PmsConnect()
|
||||||
|
@ -1902,7 +1902,7 @@ class WebInterface(object):
|
||||||
##### Search #####
|
##### Search #####
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth()
|
||||||
def search(self, query=''):
|
def search(self, query=''):
|
||||||
return serve_template(templatename="search.html", title="Search", query=query)
|
return serve_template(templatename="search.html", title="Search", query=query)
|
||||||
|
|
||||||
|
@ -1921,7 +1921,7 @@ class WebInterface(object):
|
||||||
logger.warn(u"Unable to retrieve data for search_results.")
|
logger.warn(u"Unable to retrieve data for search_results.")
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth()
|
||||||
def get_search_results_children(self, query, media_type=None, season_index=None, **kwargs):
|
def get_search_results_children(self, query, media_type=None, season_index=None, **kwargs):
|
||||||
|
|
||||||
pms_connect = pmsconnect.PmsConnect()
|
pms_connect = pmsconnect.PmsConnect()
|
||||||
|
@ -2439,8 +2439,3 @@ class WebInterface(object):
|
||||||
pms_connect = pmsconnect.PmsConnect()
|
pms_connect = pmsconnect.PmsConnect()
|
||||||
result = pms_connect.get_update_staus()
|
result = pms_connect.get_update_staus()
|
||||||
return json.dumps(result)
|
return json.dumps(result)
|
||||||
|
|
||||||
@cherrypy.expose
|
|
||||||
def test_guest_login(self, username=None, password=None):
|
|
||||||
result = users.user_login(username=username, password=password)
|
|
||||||
return result
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue