Merge branch 'main' into gali-importer-structure
This commit is contained in:
@@ -1 +1 @@
|
||||
def _(msg: str, /) -> str: ...
|
||||
def _(_msg: str, /) -> str: ...
|
||||
|
||||
@@ -82,15 +82,25 @@ def bottles_importer():
|
||||
values["source"] = "bottles"
|
||||
values["added"] = current_time
|
||||
|
||||
# This will not work if both Cartridges and Bottles are installed via Flatpak
|
||||
# as Cartridges can't access directories picked via Bottles' file picker portal
|
||||
try:
|
||||
bottles_location = Path(
|
||||
yaml.safe_load((bottles_dir / "data.yml").read_text("utf-8"))[
|
||||
"custom_bottles_path"
|
||||
]
|
||||
)
|
||||
except (FileNotFoundError, KeyError):
|
||||
bottles_location = bottles_dir / "bottles"
|
||||
|
||||
grid_path = (
|
||||
bottles_location
|
||||
/ game["bottle"]["path"]
|
||||
/ "grids"
|
||||
/ game["thumbnail"].split(":")[1]
|
||||
)
|
||||
|
||||
importer.save_game(
|
||||
values,
|
||||
(
|
||||
bottles_dir
|
||||
/ "bottles"
|
||||
/ game["bottle"]["path"]
|
||||
/ "grids"
|
||||
/ game["thumbnail"].split(":")[1]
|
||||
)
|
||||
if game["thumbnail"]
|
||||
else None,
|
||||
grid_path if game["thumbnail"] and grid_path.is_file() else None,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user