feat: add NAS management UI and operation history

This commit is contained in:
OpenClaw Agent
2026-09-18 06:53:57 +08:00
parent 0660d1f874
commit a0673ab79e
8 changed files with 247 additions and 7 deletions
+6 -1
View File
@@ -34,7 +34,12 @@ def index_file(conn, path: Path) -> None:
def scan(root: Path, db_path: Path) -> int:
count = 0
seen = set()
with connect(db_path) as conn:
for path in iter_music(root):
index_file(conn, path); count += 1
index_file(conn, path); seen.add(str(path)); count += 1
rows = conn.execute("SELECT id,file_path,status FROM audio_tracks WHERE status!='missing'").fetchall()
for row in rows:
if row["file_path"] not in seen and not Path(row["file_path"]).exists():
conn.execute("UPDATE audio_tracks SET status='missing',updated_at=CURRENT_TIMESTAMP WHERE id=?", (row["id"],))
return count