fixed metadata time import error and moved quest status widget to top of settings.

This commit is contained in:
Bryan Van Deusen
2026-01-21 11:30:45 -05:00
parent dc45a09681
commit 041a3dbfb4
7 changed files with 108 additions and 760 deletions
+6 -5
View File
@@ -273,8 +273,9 @@ def import_archive(self, task_id: int):
Returns:
dict with status and counts
"""
from app.utils.image_importer import calculate_hash, compute_next_archive_tag_name
from pyunpack import Archive
from app.utils.image_importer import (
calculate_hash, compute_next_archive_tag_name, extract_archive_resilient, ExtractError
)
task = ImportTask.query.get(task_id)
if not task:
@@ -305,13 +306,13 @@ def import_archive(self, task_id: int):
# Get archive size
archive_size = os.path.getsize(archive_path)
# Extract archive
# Extract archive using resilient extractor (tries unar then 7z for RAR)
tmpdir = tempfile.mkdtemp(prefix='extract_')
log.info(f"Extracting to: {tmpdir}")
try:
Archive(archive_path).extractall(tmpdir)
except Exception as e:
extract_archive_resilient(archive_path, tmpdir)
except ExtractError as e:
log.error(f"Extraction failed: {e}")
if tmpdir and os.path.exists(tmpdir):
shutil.rmtree(tmpdir, ignore_errors=True)