Fix incorrect or inconsistent slug generation.

Only scummvm uses "lutris_slug" but it is provided for Gog too - with stale data.
This commit is contained in:
Daniel Johnson 2024-01-10 19:39:43 -05:00
parent 0e96bed1f7
commit 659bc241da
5 changed files with 7 additions and 8 deletions

View file

@ -641,10 +641,6 @@ class AmazonService(OnlineService):
return [file_collection], []
def get_installed_slug(self, db_game):
slug = db_game.get("lutris_slug")
if slug:
return slug
details = json.loads(db_game["details"])
return slugify(details["product"]["title"])

View file

@ -263,8 +263,8 @@ class BaseService(GObject.Object):
def get_installed_slug(self, db_game):
"""Returns the slug the game will have after installation, by default. This
is Lutris's slug, not the one for the service. By default, we derive it from
the Game's name, but services override this if they provide the slug."""
return db_game.get("lutris_slug") or slugify(db_game["name"])
the Game's name."""
return slugify(db_game["name"])
def get_installed_runner_name(self, db_game):
"""Returns the name of the runner this game will have after installation, or

View file

@ -156,7 +156,7 @@ class BattleNetService(BaseService):
return slug
def get_installed_slug(self, db_game):
return db_game.get("lutris_slug") or db_game["slug"]
return db_game["slug"]
def generate_installer(self, db_game, egs_db_game):
egs_game = Game(egs_db_game["id"])

View file

@ -328,7 +328,7 @@ class ItchIoService(OnlineService):
return all_extras
def get_installed_slug(self, db_game):
return db_game.get("lutris_slug") or db_game["slug"]
return db_game["slug"]
def generate_installer(self, db_game):
"""Auto generate installer for itch.io game"""

View file

@ -71,6 +71,9 @@ class ScummvmService(BaseService):
}
}
def get_installed_slug(self, db_game):
return db_game.get("lutris_slug") or slugify(db_game["name"])
def get_installed_runner_name(self, db_game):
return "scummvm"