archive work
This commit is contained in:
+13
-2
@@ -133,8 +133,7 @@ class Archive:
|
||||
|
||||
logging.info(" - done.")
|
||||
|
||||
|
||||
def insert_db(self, config=None):
|
||||
def insert_db(self, config=None, file=None):
|
||||
|
||||
if self.db_con is None:
|
||||
if config is not None:
|
||||
@@ -143,12 +142,24 @@ class Archive:
|
||||
if self.db_con is None:
|
||||
return
|
||||
|
||||
tag = file
|
||||
if file is not None:
|
||||
tag = file.replace("_", " ")
|
||||
|
||||
try:
|
||||
cursor = self.db_con.cursor()
|
||||
|
||||
progress = terminal.progress.ProgressBar(self.archive_name, len(self.data), fmt=terminal.progress.ProgressBar.FULL)
|
||||
|
||||
for t in self.data:
|
||||
|
||||
# print(tag)
|
||||
print(t['name'])
|
||||
|
||||
if file is not None and t['name'] != tag:
|
||||
continue
|
||||
|
||||
logging.info("inserting " + t['name'])
|
||||
|
||||
n_inserted = self.recursive_insert_db(cursor, t["threads"])
|
||||
logging.info(" - " + str(n_inserted))
|
||||
|
||||
Reference in New Issue
Block a user