Compare commits

..

No commits in common. "eb98ce47cbbf36389df5899b98cc975f0a4f61ed" and "4fd448e29e5eee78259f94bc01fee45010ee9409" have entirely different histories.

4 changed files with 6 additions and 13 deletions

View file

@ -1 +1 @@
system@3.13.1
3.12.2

View file

@ -6,5 +6,6 @@
# features: []
# all-features: false
# with-sources: false
# generate-hashes: false
-e file:.

View file

@ -6,5 +6,6 @@
# features: []
# all-features: false
# with-sources: false
# generate-hashes: false
-e file:.

View file

@ -188,7 +188,7 @@ def get_db_type(cur: sqlite3.Cursor) -> Literal["firefox", "chromium"]:
return db_type
def get_browser_info(root_cur: sqlite3.Cursor, name: str) -> tuple[int, int, str] | None:
def get_browser_info(root_cur: sqlite3.Cursor, name: str) -> tuple[int, int, str]:
res = root_cur.execute(
"""
SELECT
@ -202,10 +202,7 @@ def get_browser_info(root_cur: sqlite3.Cursor, name: str) -> tuple[int, int, str
""",
(name,),
)
res_one = res.fetchone()
if res_one is None:
return None
browser_id, visits_time_max, database_path = res_one
browser_id, visits_time_max, database_path = res.fetchone()
return (browser_id, visits_time_max, database_path)
@ -253,13 +250,7 @@ def add_db(
root_con: sqlite3.Connection, root_cur: sqlite3.Cursor, args: argparse.Namespace
):
print("Add history to root db")
browser_info = get_browser_info(root_cur, args.name)
if browser_info is None:
print(f"browser {args.name} is not registered to the database")
logging.debug("Cleaning up (closing db connection)")
root_con.close()
exit(1)
browser_id, visits_time_max, database_path = browser_info
browser_id, visits_time_max, database_path = get_browser_info(root_cur, args.name)
logging.info(f"{browser_id=}, {visits_time_max=}")
logging.info(f"Source: {database_path}")