Add method to delete duplicate libraries

This commit is contained in:
JonnyWong16 2016-02-02 20:54:34 -08:00
parent ee754ea533
commit 9cd6396c35
2 changed files with 32 additions and 1 deletions

View file

@ -492,7 +492,20 @@ class WebInterface(object):
cherrypy.response.headers['Content-type'] = 'application/json'
return json.dumps({'message': 'no data received'})
else:
return json.dumps({'message': 'Cannot refresh library while getting file sizes.'})
return json.dumps({'message': 'Cannot refresh library while getting file sizes.'})
@cherrypy.expose
def delete_duplicate_libraries(self):
library_data = libraries.Libraries()
result = library_data.delete_duplicate_libraries()
if result:
cherrypy.response.headers['Content-type'] = 'application/json'
return json.dumps({'message': result})
else:
cherrypy.response.headers['Content-type'] = 'application/json'
return json.dumps({'message': 'Unable to delete duplicate libraries from the database.'})
##### Users #####