mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 07:46:07 -07:00
Make sure all endpoints have kwargs
This commit is contained in:
parent
ed2d3ca277
commit
5d604c2cad
1 changed files with 38 additions and 38 deletions
|
@ -81,7 +81,7 @@ class WebInterface(object):
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth()
|
@requireAuth()
|
||||||
def index(self):
|
def index(self, **kwargs):
|
||||||
if plexpy.CONFIG.FIRST_RUN_COMPLETE:
|
if plexpy.CONFIG.FIRST_RUN_COMPLETE:
|
||||||
raise cherrypy.HTTPRedirect(plexpy.HTTP_ROOT + "home")
|
raise cherrypy.HTTPRedirect(plexpy.HTTP_ROOT + "home")
|
||||||
else:
|
else:
|
||||||
|
@ -168,7 +168,7 @@ class WebInterface(object):
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth()
|
@requireAuth()
|
||||||
def home(self):
|
def home(self, **kwargs):
|
||||||
config = {
|
config = {
|
||||||
"home_sections": plexpy.CONFIG.HOME_SECTIONS,
|
"home_sections": plexpy.CONFIG.HOME_SECTIONS,
|
||||||
"home_stats_length": plexpy.CONFIG.HOME_STATS_LENGTH,
|
"home_stats_length": plexpy.CONFIG.HOME_STATS_LENGTH,
|
||||||
|
@ -329,7 +329,7 @@ class WebInterface(object):
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@cherrypy.tools.json_out()
|
@cherrypy.tools.json_out()
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth(member_of("admin"))
|
||||||
def delete_temp_sessions(self):
|
def delete_temp_sessions(self, **kwargs):
|
||||||
|
|
||||||
result = database.delete_sessions()
|
result = database.delete_sessions()
|
||||||
|
|
||||||
|
@ -343,7 +343,7 @@ class WebInterface(object):
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth()
|
@requireAuth()
|
||||||
def libraries(self):
|
def libraries(self, **kwargs):
|
||||||
config = {
|
config = {
|
||||||
"update_section_ids": plexpy.CONFIG.UPDATE_SECTION_IDS
|
"update_section_ids": plexpy.CONFIG.UPDATE_SECTION_IDS
|
||||||
}
|
}
|
||||||
|
@ -469,7 +469,7 @@ class WebInterface(object):
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth()
|
@requireAuth()
|
||||||
def library(self, section_id=None):
|
def library(self, section_id=None, **kwargs):
|
||||||
if not allow_session_library(section_id):
|
if not allow_session_library(section_id):
|
||||||
raise cherrypy.HTTPRedirect(plexpy.HTTP_ROOT)
|
raise cherrypy.HTTPRedirect(plexpy.HTTP_ROOT)
|
||||||
|
|
||||||
|
@ -708,7 +708,7 @@ class WebInterface(object):
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@cherrypy.tools.json_out()
|
@cherrypy.tools.json_out()
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth(member_of("admin"))
|
||||||
def get_media_info_file_sizes(self, section_id=None, rating_key=None):
|
def get_media_info_file_sizes(self, section_id=None, rating_key=None, **kwargs):
|
||||||
get_file_sizes_hold = plexpy.CONFIG.GET_FILE_SIZES_HOLD
|
get_file_sizes_hold = plexpy.CONFIG.GET_FILE_SIZES_HOLD
|
||||||
section_ids = set(get_file_sizes_hold['section_ids'])
|
section_ids = set(get_file_sizes_hold['section_ids'])
|
||||||
rating_keys = set(get_file_sizes_hold['rating_keys'])
|
rating_keys = set(get_file_sizes_hold['rating_keys'])
|
||||||
|
@ -999,7 +999,7 @@ class WebInterface(object):
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@cherrypy.tools.json_out()
|
@cherrypy.tools.json_out()
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth(member_of("admin"))
|
||||||
def delete_duplicate_libraries(self):
|
def delete_duplicate_libraries(self, **kwargs):
|
||||||
library_data = libraries.Libraries()
|
library_data = libraries.Libraries()
|
||||||
|
|
||||||
result = library_data.delete_duplicate_libraries()
|
result = library_data.delete_duplicate_libraries()
|
||||||
|
@ -1013,7 +1013,7 @@ class WebInterface(object):
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth()
|
@requireAuth()
|
||||||
def users(self):
|
def users(self, **kwargs):
|
||||||
return serve_template(templatename="users.html", title="Users")
|
return serve_template(templatename="users.html", title="Users")
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
|
@ -1100,7 +1100,7 @@ class WebInterface(object):
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth()
|
@requireAuth()
|
||||||
def user(self, user_id=None):
|
def user(self, user_id=None, **kwargs):
|
||||||
if not allow_session_user(user_id):
|
if not allow_session_user(user_id):
|
||||||
raise cherrypy.HTTPRedirect(plexpy.HTTP_ROOT)
|
raise cherrypy.HTTPRedirect(plexpy.HTTP_ROOT)
|
||||||
|
|
||||||
|
@ -1566,7 +1566,7 @@ class WebInterface(object):
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth()
|
@requireAuth()
|
||||||
def history(self):
|
def history(self, **kwargs):
|
||||||
return serve_template(templatename="history.html", title="History")
|
return serve_template(templatename="history.html", title="History")
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
|
@ -1740,7 +1740,7 @@ class WebInterface(object):
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth()
|
@requireAuth()
|
||||||
def graphs(self):
|
def graphs(self, **kwargs):
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
"graph_type": plexpy.CONFIG.GRAPH_TYPE,
|
"graph_type": plexpy.CONFIG.GRAPH_TYPE,
|
||||||
|
@ -1753,7 +1753,7 @@ class WebInterface(object):
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth(member_of("admin"))
|
||||||
def set_graph_config(self, graph_type=None, graph_days=None, graph_tab=None):
|
def set_graph_config(self, graph_type=None, graph_days=None, graph_tab=None, **kwargs):
|
||||||
if graph_type:
|
if graph_type:
|
||||||
plexpy.CONFIG.__setattr__('GRAPH_TYPE', graph_type)
|
plexpy.CONFIG.__setattr__('GRAPH_TYPE', graph_type)
|
||||||
plexpy.CONFIG.write()
|
plexpy.CONFIG.write()
|
||||||
|
@ -2203,7 +2203,7 @@ class WebInterface(object):
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth()
|
@requireAuth()
|
||||||
def sync(self):
|
def sync(self, **kwargs):
|
||||||
return serve_template(templatename="sync.html", title="Synced Items")
|
return serve_template(templatename="sync.html", title="Synced Items")
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
|
@ -2229,7 +2229,7 @@ class WebInterface(object):
|
||||||
##### Logs #####
|
##### Logs #####
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth(member_of("admin"))
|
||||||
def logs(self):
|
def logs(self, **kwargs):
|
||||||
return serve_template(templatename="logs.html", title="Log")
|
return serve_template(templatename="logs.html", title="Log")
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
|
@ -2443,7 +2443,7 @@ class WebInterface(object):
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@cherrypy.tools.json_out()
|
@cherrypy.tools.json_out()
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth(member_of("admin"))
|
||||||
def delete_logs(self):
|
def delete_logs(self, **kwargs):
|
||||||
log_file = logger.FILENAME
|
log_file = logger.FILENAME
|
||||||
try:
|
try:
|
||||||
open(os.path.join(plexpy.CONFIG.LOG_DIR, log_file), 'w').close()
|
open(os.path.join(plexpy.CONFIG.LOG_DIR, log_file), 'w').close()
|
||||||
|
@ -2459,7 +2459,7 @@ class WebInterface(object):
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth(member_of("admin"))
|
||||||
def toggleVerbose(self):
|
def toggleVerbose(self, **kwargs):
|
||||||
plexpy.VERBOSE = not plexpy.VERBOSE
|
plexpy.VERBOSE = not plexpy.VERBOSE
|
||||||
logger.initLogger(console=not plexpy.QUIET,
|
logger.initLogger(console=not plexpy.QUIET,
|
||||||
log_dir=plexpy.CONFIG.LOG_DIR, verbose=plexpy.VERBOSE)
|
log_dir=plexpy.CONFIG.LOG_DIR, verbose=plexpy.VERBOSE)
|
||||||
|
@ -2469,7 +2469,7 @@ class WebInterface(object):
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth()
|
@requireAuth()
|
||||||
def log_js_errors(self, page, message, file, line):
|
def log_js_errors(self, page, message, file, line, **kwargs):
|
||||||
""" 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],
|
||||||
message,
|
message,
|
||||||
|
@ -2479,7 +2479,7 @@ class WebInterface(object):
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth(member_of("admin"))
|
||||||
def logFile(self):
|
def logFile(self, **kwargs):
|
||||||
try:
|
try:
|
||||||
with open(os.path.join(plexpy.CONFIG.LOG_DIR, logger.FILENAME), 'r') as f:
|
with open(os.path.join(plexpy.CONFIG.LOG_DIR, logger.FILENAME), 'r') as f:
|
||||||
return '<pre>%s</pre>' % f.read()
|
return '<pre>%s</pre>' % f.read()
|
||||||
|
@ -2764,7 +2764,7 @@ class WebInterface(object):
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@cherrypy.tools.json_out()
|
@cherrypy.tools.json_out()
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth(member_of("admin"))
|
||||||
def backup_config(self):
|
def backup_config(self, **kwargs):
|
||||||
""" Creates a manual backup of the plexpy.db file """
|
""" Creates a manual backup of the plexpy.db file """
|
||||||
|
|
||||||
result = config.make_backup()
|
result = config.make_backup()
|
||||||
|
@ -2787,7 +2787,7 @@ class WebInterface(object):
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@cherrypy.tools.json_out()
|
@cherrypy.tools.json_out()
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth(member_of("admin"))
|
||||||
def get_server_update_params(self):
|
def get_server_update_params(self, **kwargs):
|
||||||
plex_tv = plextv.PlexTV()
|
plex_tv = plextv.PlexTV()
|
||||||
plexpass = plex_tv.get_plexpass_status()
|
plexpass = plex_tv.get_plexpass_status()
|
||||||
return {'plexpass': plexpass,
|
return {'plexpass': plexpass,
|
||||||
|
@ -2800,7 +2800,7 @@ class WebInterface(object):
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@cherrypy.tools.json_out()
|
@cherrypy.tools.json_out()
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth(member_of("admin"))
|
||||||
def backup_db(self):
|
def backup_db(self, **kwargs):
|
||||||
""" Creates a manual backup of the plexpy.db file """
|
""" Creates a manual backup of the plexpy.db file """
|
||||||
|
|
||||||
result = database.make_backup()
|
result = database.make_backup()
|
||||||
|
@ -2814,7 +2814,7 @@ class WebInterface(object):
|
||||||
@cherrypy.tools.json_out()
|
@cherrypy.tools.json_out()
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth(member_of("admin"))
|
||||||
@addtoapi()
|
@addtoapi()
|
||||||
def install_geoip_db(self):
|
def install_geoip_db(self, **kwargs):
|
||||||
""" Downloads and installs the GeoLite2 database """
|
""" Downloads and installs the GeoLite2 database """
|
||||||
|
|
||||||
result = helpers.install_geoip_db()
|
result = helpers.install_geoip_db()
|
||||||
|
@ -2828,7 +2828,7 @@ class WebInterface(object):
|
||||||
@cherrypy.tools.json_out()
|
@cherrypy.tools.json_out()
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth(member_of("admin"))
|
||||||
@addtoapi()
|
@addtoapi()
|
||||||
def uninstall_geoip_db(self):
|
def uninstall_geoip_db(self, **kwargs):
|
||||||
""" Uninstalls the GeoLite2 database """
|
""" Uninstalls the GeoLite2 database """
|
||||||
|
|
||||||
result = helpers.uninstall_geoip_db()
|
result = helpers.uninstall_geoip_db()
|
||||||
|
@ -2958,14 +2958,14 @@ class WebInterface(object):
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth(member_of("admin"))
|
||||||
def facebookStep1(self):
|
def facebookStep1(self, **kwargs):
|
||||||
cherrypy.response.headers['Cache-Control'] = "max-age=0,no-cache,no-store"
|
cherrypy.response.headers['Cache-Control'] = "max-age=0,no-cache,no-store"
|
||||||
facebook = notifiers.FacebookNotifier()
|
facebook = notifiers.FacebookNotifier()
|
||||||
return facebook._get_authorization()
|
return facebook._get_authorization()
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth(member_of("admin"))
|
||||||
def facebookStep2(self, code):
|
def facebookStep2(self, code, **kwargs):
|
||||||
cherrypy.response.headers['Cache-Control'] = "max-age=0,no-cache,no-store"
|
cherrypy.response.headers['Cache-Control'] = "max-age=0,no-cache,no-store"
|
||||||
facebook = notifiers.FacebookNotifier()
|
facebook = notifiers.FacebookNotifier()
|
||||||
result = facebook._get_credentials(code)
|
result = facebook._get_credentials(code)
|
||||||
|
@ -2977,7 +2977,7 @@ class WebInterface(object):
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth(member_of("admin"))
|
||||||
def osxnotifyregister(self, app):
|
def osxnotifyregister(self, app, **kwargs):
|
||||||
cherrypy.response.headers['Cache-Control'] = "max-age=0,no-cache,no-store"
|
cherrypy.response.headers['Cache-Control'] = "max-age=0,no-cache,no-store"
|
||||||
from osxnotify import registerapp as osxnotify
|
from osxnotify import registerapp as osxnotify
|
||||||
|
|
||||||
|
@ -3175,20 +3175,20 @@ class WebInterface(object):
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth(member_of("admin"))
|
||||||
def generateAPI(self):
|
def generateAPI(self, **kwargs):
|
||||||
apikey = hashlib.sha224(str(random.getrandbits(256))).hexdigest()[0:32]
|
apikey = hashlib.sha224(str(random.getrandbits(256))).hexdigest()[0:32]
|
||||||
logger.info(u"New API key generated.")
|
logger.info(u"New API key generated.")
|
||||||
return apikey
|
return apikey
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth(member_of("admin"))
|
||||||
def checkGithub(self):
|
def checkGithub(self, **kwargs):
|
||||||
versioncheck.checkGithub()
|
versioncheck.checkGithub()
|
||||||
raise cherrypy.HTTPRedirect(plexpy.HTTP_ROOT + "home")
|
raise cherrypy.HTTPRedirect(plexpy.HTTP_ROOT + "home")
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth(member_of("admin"))
|
||||||
def do_state_change(self, signal, title, timer):
|
def do_state_change(self, signal, title, timer, **kwargs):
|
||||||
message = title
|
message = title
|
||||||
quote = self.random_arnold_quotes()
|
quote = self.random_arnold_quotes()
|
||||||
plexpy.SIGNAL = signal
|
plexpy.SIGNAL = signal
|
||||||
|
@ -3198,17 +3198,17 @@ class WebInterface(object):
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth(member_of("admin"))
|
||||||
def shutdown(self):
|
def shutdown(self, **kwargs):
|
||||||
return self.do_state_change('shutdown', 'Shutting Down', 15)
|
return self.do_state_change('shutdown', 'Shutting Down', 15)
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth(member_of("admin"))
|
||||||
def restart(self):
|
def restart(self, **kwargs):
|
||||||
return self.do_state_change('restart', 'Restarting', 30)
|
return self.do_state_change('restart', 'Restarting', 30)
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth(member_of("admin"))
|
||||||
def update(self):
|
def update(self, **kwargs):
|
||||||
return self.do_state_change('update', 'Updating', 120)
|
return self.do_state_change('update', 'Updating', 120)
|
||||||
|
|
||||||
|
|
||||||
|
@ -3331,7 +3331,7 @@ class WebInterface(object):
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth(member_of("admin"))
|
||||||
@addtoapi()
|
@addtoapi()
|
||||||
def download_log(self):
|
def download_log(self, **kwargs):
|
||||||
""" Download the PlexPy log file. """
|
""" Download the PlexPy log file. """
|
||||||
log_file = logger.FILENAME
|
log_file = logger.FILENAME
|
||||||
try:
|
try:
|
||||||
|
@ -3369,7 +3369,7 @@ class WebInterface(object):
|
||||||
@cherrypy.tools.json_out()
|
@cherrypy.tools.json_out()
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth(member_of("admin"))
|
||||||
@addtoapi()
|
@addtoapi()
|
||||||
def delete_image_cache(self):
|
def delete_image_cache(self, **kwargs):
|
||||||
""" Delete and recreate the image cache directory. """
|
""" Delete and recreate the image cache directory. """
|
||||||
return self.delete_cache(folder='images')
|
return self.delete_cache(folder='images')
|
||||||
|
|
||||||
|
@ -3377,7 +3377,7 @@ class WebInterface(object):
|
||||||
@cherrypy.tools.json_out()
|
@cherrypy.tools.json_out()
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth(member_of("admin"))
|
||||||
@addtoapi()
|
@addtoapi()
|
||||||
def delete_cache(self, folder=''):
|
def delete_cache(self, folder='', **kwargs):
|
||||||
""" Delete and recreate the cache directory. """
|
""" Delete and recreate the cache directory. """
|
||||||
cache_dir = os.path.join(plexpy.CONFIG.CACHE_DIR, folder)
|
cache_dir = os.path.join(plexpy.CONFIG.CACHE_DIR, folder)
|
||||||
result = 'success'
|
result = 'success'
|
||||||
|
@ -3404,7 +3404,7 @@ class WebInterface(object):
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@cherrypy.tools.json_out()
|
@cherrypy.tools.json_out()
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth(member_of("admin"))
|
||||||
def delete_poster_url(self, poster_url=''):
|
def delete_poster_url(self, poster_url='', **kwargs):
|
||||||
|
|
||||||
if poster_url:
|
if poster_url:
|
||||||
data_factory = datafactory.DataFactory()
|
data_factory = datafactory.DataFactory()
|
||||||
|
@ -3422,7 +3422,7 @@ class WebInterface(object):
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth()
|
@requireAuth()
|
||||||
def search(self, query=''):
|
def search(self, query='', **kwargs):
|
||||||
return serve_template(templatename="search.html", title="Search", query=query)
|
return serve_template(templatename="search.html", title="Search", query=query)
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
|
@ -4284,7 +4284,7 @@ class WebInterface(object):
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@cherrypy.tools.json_out()
|
@cherrypy.tools.json_out()
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth(member_of("admin"))
|
||||||
def check_pms_updater(self):
|
def check_pms_updater(self, **kwargs):
|
||||||
pms_connect = pmsconnect.PmsConnect()
|
pms_connect = pmsconnect.PmsConnect()
|
||||||
result = pms_connect.get_update_staus()
|
result = pms_connect.get_update_staus()
|
||||||
return result
|
return result
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue