Add backup back to api
This commit is contained in:
@@ -275,6 +275,18 @@ class API2:
|
|||||||
self.data = rows
|
self.data = rows
|
||||||
return rows
|
return rows
|
||||||
|
|
||||||
|
def backupdb(self):
|
||||||
|
""" Creates a manual backup of the plexpy.db file """
|
||||||
|
|
||||||
|
data = database.make_backup()
|
||||||
|
|
||||||
|
if data:
|
||||||
|
self.result_type = 'success'
|
||||||
|
else:
|
||||||
|
self.result_type = 'failed'
|
||||||
|
|
||||||
|
return data
|
||||||
|
|
||||||
def restart(self, **kwargs):
|
def restart(self, **kwargs):
|
||||||
""" Restarts plexpy """
|
""" Restarts plexpy """
|
||||||
|
|
||||||
|
@@ -1354,11 +1354,10 @@ class WebInterface(object):
|
|||||||
return serve_template(templatename="scheduler_table.html")
|
return serve_template(templatename="scheduler_table.html")
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@addtoapi()
|
|
||||||
def backup_db(self):
|
def backup_db(self):
|
||||||
""" Creates a manual backup of the plexpy.db file """
|
""" Creates a manual backup of the plexpy.db file """
|
||||||
|
|
||||||
result = database.make_backup(scheduler=False)
|
result = database.make_backup()
|
||||||
|
|
||||||
if result:
|
if result:
|
||||||
cherrypy.response.headers['Content-type'] = 'application/json'
|
cherrypy.response.headers['Content-type'] = 'application/json'
|
||||||
|
Reference in New Issue
Block a user