chore(scan-vids): switch db target and logs
This commit is contained in:
Regular → Executable
+3
-3
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
#!/usr/bin/env -S uv run
|
||||
# /// script
|
||||
# requires-python = ">=3.11"
|
||||
# dependencies = [
|
||||
@@ -36,7 +36,7 @@ def hash_partial(f: Path) -> str:
|
||||
|
||||
@contextlib.contextmanager
|
||||
def connect_db() -> typing.Generator[psycopg.Connection, typing.Any, typing.Any]:
|
||||
with psycopg.connect("postgres://abdus:abdus@db.abdus.dev:5444/smut?sslmode=disable") as conn:
|
||||
with psycopg.connect("postgres://abdus:abdus@db.abdus.dev:5444/snot?sslmode=disable") as conn:
|
||||
conn.row_factory = psycopg.rows.dict_row
|
||||
yield conn
|
||||
|
||||
@@ -120,7 +120,7 @@ def scan_videos(con: psycopg.Connection, video_paths: list[Path]) -> None:
|
||||
ffprobe=probed.__dict__,
|
||||
hash_partial=file_hash,
|
||||
)
|
||||
logging.info(f"{progress} saved {f=}")
|
||||
logging.info(f"{progress} saved: {f.name}")
|
||||
con.commit()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user