mirror of
https://github.com/PR0M3TH3AN/Marlin.git
synced 2025-09-08 23:28:44 +00:00
update
This commit is contained in:
@@ -52,16 +52,15 @@ fn main() -> Result<()> {
|
||||
/* ── open DB (runs migrations) ───────────────────────────── */
|
||||
let mut conn = db::open(&cfg.db_path)?;
|
||||
|
||||
/* ── command dispatch ────────────────────────────────────── */
|
||||
match args.command {
|
||||
/* ── command dispatch ────────────────────────────────────── */
|
||||
match args.command {
|
||||
Commands::Completions { .. } => {} // handled above
|
||||
|
||||
/* ---- init ------------------------------------------------ */
|
||||
Commands::Init => {
|
||||
info!("Database initialised at {}", cfg.db_path.display());
|
||||
let cwd = env::current_dir().context("getting current directory")?;
|
||||
let count =
|
||||
scan::scan_directory(&mut conn, &cwd).context("initial scan failed")?;
|
||||
let count = scan::scan_directory(&mut conn, &cwd).context("initial scan failed")?;
|
||||
info!("Initial scan complete – indexed/updated {count} files");
|
||||
}
|
||||
|
||||
@@ -76,11 +75,8 @@ match args.command {
|
||||
if dirty {
|
||||
let dirty_ids = take_dirty(&conn)?;
|
||||
for id in dirty_ids {
|
||||
let path: String = conn.query_row(
|
||||
"SELECT path FROM files WHERE id = ?1",
|
||||
[id],
|
||||
|r| r.get(0),
|
||||
)?;
|
||||
let path: String =
|
||||
conn.query_row("SELECT path FROM files WHERE id = ?1", [id], |r| r.get(0))?;
|
||||
scan::scan_directory(&mut conn, Path::new(&path))?;
|
||||
}
|
||||
} else {
|
||||
@@ -152,9 +148,10 @@ match args.command {
|
||||
Commands::Version(v_cmd) => cli::version::run(&v_cmd, &mut conn, args.format)?,
|
||||
Commands::Event(e_cmd) => cli::event::run(&e_cmd, &mut conn, args.format)?,
|
||||
Commands::Watch(watch_cmd) => cli::watch::run(&watch_cmd, &mut conn, args.format)?,
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/* ─────────────────── helpers & sub-routines ─────────────────── */
|
||||
|
||||
|
Reference in New Issue
Block a user