Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions games/baldursgate3/pak_parser.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import configparser
import hashlib
import itertools
import os
import re
import shutil
Expand Down Expand Up @@ -139,15 +138,14 @@ def _get_metadata_for_file(
meta_file.unlink(missing_ok=True)
if self._utils.extract_full_package:
Path(str(meta_file)[:-4]).unlink(missing_ok=True)
elif file.is_dir() and self._folder_pattern.search(file.name):
# qDebug(f"directory is not packable: {file}")
return ""
elif next(
itertools.chain(
file.glob(f"{folder}/*") for folder in bg3_utils.loose_file_folders
),
False,
):
elif file.is_dir():
if self._folder_pattern.search(file.name):
return ""
for folder in bg3_utils.loose_file_folders:
if next(file.glob(f"{folder}/*"), False):
break
else:
return ""
qInfo(f"packable dir: {file}")
if (file.parent / f"{file.name}.pak").exists() or (
file.parent / "Mods" / f"{file.name}.pak"
Expand Down Expand Up @@ -187,7 +185,6 @@ def _get_metadata_for_file(
lambda: meta_files[0],
)
else:
# qDebug(f"non packable dir, unlikely to be used by the game: {file}")
return ""
except Exception:
qWarning(traceback.format_exc())
Expand Down