Exemplo n.º 1
0
    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)
Exemplo n.º 2
0
    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)
Exemplo n.º 3
0
def main():
    try:
        lib = Library(conf.library_dir)

        if conf.action == "clean":
            cleaner = Cleaner(lib)
            print("Removing duplicates..."),
            cleaner.remove_duplicates()
            print("DONE")

            cleaner.report()

            if not conf.test:
                lib.flush()
                print("\nTraktor library updated.")
            else:
                print("\nTest run. No changes made to the library.")
        elif conf.action == "export":
            exporter = Exporter(lib, conf.export_dir)
            exporter.export()

    except Exception as e:
        logger.error(e, exc_info=False)
Exemplo n.º 4
0
def main():
    try:
        lib = Library(conf.library_dir)
        logger.debug("Starting")

        if conf.action == "clean":
            cleaner = Cleaner(lib)
            print("Removing duplicates..."),
            cleaner.remove_duplicates()
            print("DONE")

            cleaner.report()

            if not conf.test:
                lib.flush()
                print("\nTraktor library updated.")
            else:
                print("\nTest run. No changes made to the library.")
        elif conf.action == "export":
            exporter = Exporter(lib, conf.export_dir)
            exporter.export()

    except Exception as e:
        logger.error(e, exc_info=False)