def GET(self): if not librarian.is_traktor_running(): response = {"status": "ok"} else: response = {"status": "error", "message": "Please quit Traktor first."} web.header("Cache-Control", "no-cache") return json.dumps(response)
def GET(self): if librarian.is_traktor_running(): response = {"status": "error", "message": "Please quit Traktor first."} else: cleaner = Cleaner(Library.instance()) cleaner.remove_duplicates() logger.debug(u"Duplicate removal complete") response = cleaner.get_result() response["status"] = "ok" web.header("Cache-Control", "no-cache") return json.dumps(response)
def POST(self): request = json.loads(web.data()) if librarian.is_traktor_running(): response = {"status": "error", "message": "Please quit it first."} else: conf.remove_orphans = request["remove_orphans"] export_worker = threading.Thread(target=self._export, args=(request["destination"],)) export_worker.start() response = {"status": "ok"} web.header("Cache-Control", "no-cache") return json.dumps(response)