feat: add acoustic dedupe pipeline and docker runtime
This commit is contained in:
+11
-21
@@ -1,28 +1,18 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
|
||||
from .exact import exact_dedupe
|
||||
from .scanner import scan
|
||||
from .l2 import acoustic_dedupe
|
||||
from .watcher import watch
|
||||
|
||||
|
||||
def main() -> None:
|
||||
p = argparse.ArgumentParser(prog="am-deduper")
|
||||
sub = p.add_subparsers(dest="cmd", required=True)
|
||||
for name in ("scan", "dedupe", "reconcile", "watch"):
|
||||
sp = sub.add_parser(name)
|
||||
sp.add_argument("root", type=Path)
|
||||
sp.add_argument("--db", type=Path, default=None)
|
||||
args = p.parse_args()
|
||||
db = args.db or (args.root / ".dedupe" / "dedupe.db")
|
||||
if args.cmd == "watch":
|
||||
watch(args.root, db)
|
||||
return
|
||||
if args.cmd in {"scan", "reconcile"}:
|
||||
print(f"indexed={scan(args.root, db)} db={db}")
|
||||
if args.cmd == "dedupe":
|
||||
scan(args.root, db)
|
||||
actions = exact_dedupe(db, args.root)
|
||||
print(f"hardlinked={len(actions)}")
|
||||
def main():
|
||||
p=argparse.ArgumentParser(prog='am-deduper'); sub=p.add_subparsers(dest='cmd',required=True)
|
||||
for name in ('scan','dedupe','reconcile','watch'):
|
||||
sp=sub.add_parser(name); sp.add_argument('root',type=Path); sp.add_argument('--db',type=Path,default=None)
|
||||
a=p.parse_args(); db=a.db or a.root/'.dedupe'/'dedupe.db'
|
||||
if a.cmd=='watch': watch(a.root,db); return
|
||||
print(f'indexed={scan(a.root,db)} db={db}')
|
||||
if a.cmd in ('dedupe','reconcile'):
|
||||
ex=exact_dedupe(db,a.root); print(f'exact_hardlinked={len(ex)}')
|
||||
l2=acoustic_dedupe(db,a.root); print(f'l2={l2}')
|
||||
|
||||
Reference in New Issue
Block a user