name change and local sync added
This commit is contained in:
@@ -49,7 +49,7 @@ async def lifespan(app: FastAPI):
|
||||
_scheduler.shutdown(wait=False)
|
||||
|
||||
|
||||
app = FastAPI(title="CalibreSync", lifespan=lifespan)
|
||||
app = FastAPI(title="GrimmorySync", lifespan=lifespan)
|
||||
app.mount("/static", StaticFiles(directory=Path(__file__).parent / "static"), name="static")
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ class SettingsPayload(BaseModel):
|
||||
grimmory_user: str = ""
|
||||
grimmory_password: str = ""
|
||||
grimmory_bookdrop_path: str = ""
|
||||
work_dir: str = "/tmp/calibresync"
|
||||
work_dir: str = "/tmp/grimmorysync"
|
||||
scheduler_interval_minutes: str = "0"
|
||||
sync_batch_size: str = "0"
|
||||
|
||||
@@ -141,6 +141,19 @@ async def api_trigger_rescan(background_tasks: BackgroundTasks):
|
||||
return {"ok": True}
|
||||
|
||||
|
||||
# --- Local folder import ---
|
||||
|
||||
@app.post("/api/import/local")
|
||||
async def api_local_import(background_tasks: BackgroundTasks):
|
||||
if sync.is_running():
|
||||
return {"ok": False, "reason": "already_running"}
|
||||
folder = db.get_setting("local_import_path", "")
|
||||
if not folder:
|
||||
return {"ok": False, "reason": "no_path_configured"}
|
||||
background_tasks.add_task(sync.run_local_import, folder)
|
||||
return {"ok": True}
|
||||
|
||||
|
||||
# --- Connection tests ---
|
||||
|
||||
@app.get("/api/test/ssh")
|
||||
|
||||
Reference in New Issue
Block a user