continuing refactor

This commit is contained in:
2026-05-03 21:20:05 -07:00
parent 77cab1bd27
commit 5534812426
50 changed files with 1004 additions and 428 deletions
+5 -5
View File
@@ -793,9 +793,9 @@ def main() -> int:
conn.row_factory = sqlite3.Row
cur = conn.cursor()
# Find all existing hydrusnetwork store names
# Find all existing hydrusnetwork instance names
cur.execute(
"SELECT DISTINCT item_name FROM config WHERE category='store' AND subtype='hydrusnetwork'"
"SELECT DISTINCT item_name FROM config WHERE category='plugin' AND subtype='hydrusnetwork'"
)
rows = cur.fetchall()
item_names = [r[0] for r in rows if r[0]]
@@ -804,12 +804,12 @@ def main() -> int:
# Only create if none exist. Use a sensible name from the path if possible.
# We don't have the hydrus_path here easily, but we can try to find it.
# For now, if we are in bootstrap, we might just be setting a global.
# But this function is specifically for store settings.
# But this function is specifically for instance settings.
# Let's use 'home' instead of 'hydrus' as it's the standard default.
item_name = "home"
cur.execute(
"INSERT OR REPLACE INTO config (category, subtype, item_name, key, value) VALUES (?, ?, ?, ?, ?)",
('store', 'hydrusnetwork', item_name, 'NAME', item_name)
('plugin', 'hydrusnetwork', item_name, 'NAME', item_name)
)
item_names = [item_name]
@@ -817,7 +817,7 @@ def main() -> int:
for name in item_names:
cur.execute(
"INSERT OR REPLACE INTO config (category, subtype, item_name, key, value) VALUES (?, ?, ?, ?, ?)",
('store', 'hydrusnetwork', name, key, value)
('plugin', 'hydrusnetwork', name, key, value)
)
conn.commit()
+1 -1
View File
@@ -335,7 +335,7 @@ def main(argv: Optional[List[str]] = None) -> int:
# expand it into argv tokens (PowerShell commonly encourages quoting strings).
#
# Examples:
# mm "download-file <url> | add-tag 'x' | add-file -store local"
# mm "download-file <url> | add-tag 'x' | add-file -instance local"
# mm "download-file '<url>' -query 'format:720' -path 'C:\\out'"
if len(clean_args) == 1:
single = clean_args[0]
+3 -3
View File
@@ -188,7 +188,7 @@ def update_medios_config(hydrus_path: Path) -> bool:
cur = conn.cursor()
cur.execute(
"SELECT DISTINCT item_name FROM config WHERE category='store' AND subtype='hydrusnetwork'"
"SELECT DISTINCT item_name FROM config WHERE category='plugin' AND subtype='hydrusnetwork'"
)
rows = [row[0] for row in cur.fetchall() if row[0]]
@@ -196,14 +196,14 @@ def update_medios_config(hydrus_path: Path) -> bool:
store_name = _sanitize_store_name(hydrus_path.name)
cur.execute(
"INSERT OR REPLACE INTO config (category, subtype, item_name, key, value) VALUES (?, ?, ?, ?, ?)",
('store', 'hydrusnetwork', store_name, 'name', store_name)
('plugin', 'hydrusnetwork', store_name, 'name', store_name)
)
rows = [store_name]
for name in rows:
cur.execute(
"INSERT OR REPLACE INTO config (category, subtype, item_name, key, value) VALUES (?, ?, ?, ?, ?)",
('store', 'hydrusnetwork', name, 'gitclone', hydrus_abs_path)
('plugin', 'hydrusnetwork', name, 'gitclone', hydrus_abs_path)
)
conn.commit()