prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Don't show Steam Linux Runtime when importing games
  Link to the tool on steamdb: https://steamdb.info/app/1070560/
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `lutris/services/steam.py`
  Content:
  ```
  1 """Steam service"""
  2 import os
  3 import re
  4 
  5 from lutris import pga
  6 from lutris.config import make_game_config_id, LutrisConfig
  7 from lutris.util.steam.appmanifest import AppManifest, get_appmanifests
  8 from lutris.util.steam.config import get_steamapps_paths
  9 from lutris.services.service_game import ServiceGame
  10 
  11 NAME = "Steam"
  12 ICON = "steam"
  13 ONLINE = False
  14 
  15 
  16 class SteamGame(ServiceGame):
  17     """ServiceGame for Steam games"""
  18 
  19     store = "steam"
  20     installer_slug = "steam"
  21     excluded_appids = [
  22         "228980",  # Steamworks Common Redistributables
  23     ]
  24 
  25     @classmethod
  26     def new_from_steam_game(cls, appmanifest, game_id=None):
  27         """Return a Steam game instance from an AppManifest"""
  28         steam_game = SteamGame()
  29         steam_game.appid = str(appmanifest.steamid)
  30         steam_game.game_id = game_id
  31         steam_game.name = appmanifest.name
  32         steam_game.slug = appmanifest.slug
  33         steam_game.runner = appmanifest.get_runner_name()
  34         return steam_game
  35 
  36     @classmethod
  37     def new_from_lutris_id(cls, game_id):
  38         steam_game = SteamGame()
  39         steam_game.game_id = game_id
  40         return steam_game
  41 
  42     @property
  43     def config_id(self):
  44         return make_game_config_id(self.slug)
  45 
  46     @classmethod
  47     def is_importable(cls, appmanifest):
  48         """Return whether a Steam game should be imported"""
  49         if not appmanifest.is_installed():
  50             return False
  51         if appmanifest.steamid in cls.excluded_appids:
  52             return False
  53         if re.match(r"^Proton \d*", appmanifest.name):
  54             return False
  55         return True
  56 
  57     def install(self, updated_info=None):
  58         """Add an installed game to the library
  59 
  60         Params:
  61             updated_info (dict): Optional dictonary containing existing data not to overwrite
  62         """
  63         if updated_info:
  64             name = updated_info["name"]
  65             slug = updated_info["slug"]
  66         else:
  67             name = self.name
  68             slug = self.slug
  69         self.game_id = pga.add_or_update(
  70             id=self.game_id,
  71             name=name,
  72             runner=self.runner,
  73             slug=slug,
  74             steamid=int(self.appid),
  75             installed=1,
  76             configpath=self.config_id,
  77             installer_slug=self.installer_slug,
  78         )
  79         self.create_config()
  80         return self.game_id
  81 
  82     def create_config(self):
  83         """Create the game configuration for a Steam game"""
  84         game_config = LutrisConfig(
  85             runner_slug=self.runner, game_config_id=self.config_id
  86         )
  87         game_config.raw_game_config.update({"appid": self.appid})
  88         game_config.save()
  89 
  90 
  91 class SteamSyncer:
  92     platform = "linux"
  93 
  94     def __init__(self):
  95         self._lutris_games = None
  96         self._lutris_steamids = None
  97 
  98     @property
  99     def runner(self):
  100         return "steam" if self.platform == "linux" else "winesteam"
  101 
  102     @property
  103     def lutris_games(self):
  104         if not self._lutris_games:
  105             self._lutris_games = pga.get_games_where(
  106                 steamid__isnull=False, steamid__not=""
  107             )
  108         return self._lutris_games
  109 
  110     @property
  111     def lutris_steamids(self):
  112         if not self._lutris_steamids:
  113             self._lutris_steamids = {str(game["steamid"]) for game in self.lutris_games}
  114         return self._lutris_steamids
  115 
  116     def load(self, force_reload=False):
  117         """Return importable Steam games"""
  118         games = []
  119         steamapps_paths = get_steamapps_paths()
  120         for steamapps_path in steamapps_paths[self.platform]:
  121             for appmanifest_file in get_appmanifests(steamapps_path):
  122                 app_manifest = AppManifest(
  123                     os.path.join(steamapps_path, appmanifest_file)
  124                 )
  125                 if SteamGame.is_importable(app_manifest):
  126                     games.append(SteamGame.new_from_steam_game(app_manifest))
  127         return games
  128 
  129     def get_pga_game(self, game):
  130         """Return a PGA game if one is found"""
  131         for pga_game in self.lutris_games:
  132             if (
  133                     str(pga_game["steamid"]) == game.appid
  134                     and (pga_game["runner"] == self.runner or not pga_game["runner"])
  135                     and not pga_game["installed"]
  136             ):
  137                 return pga_game
  138 
  139     def sync(self, games, full=False):
  140         """Syncs Steam games to Lutris"""
  141         available_ids = set()  # Set of Steam appids seen while browsing AppManifests
  142         added_games = []
  143         for game in games:
  144             steamid = game.appid
  145             available_ids.add(steamid)
  146             pga_game = self.get_pga_game(game)
  147 
  148             if pga_game:
  149                 if (
  150                     steamid in self.lutris_steamids
  151                     and pga_game["installed"] != 1
  152                     and pga_game["installed"]
  153                 ):
  154                     added_games.append(game.install())
  155 
  156             if steamid not in self.lutris_steamids:
  157                 added_games.append(game.install())
  158             else:
  159                 if pga_game:
  160                     added_games.append(game.install(pga_game))
  161 
  162         if not full:
  163             return added_games, games
  164 
  165         removed_games = []
  166         unavailable_ids = self.lutris_steamids.difference(available_ids)
  167         for steamid in unavailable_ids:
  168             for pga_game in self.lutris_games:
  169                 if (
  170                     str(pga_game["steamid"]) == steamid
  171                     and pga_game["installed"]
  172                     and pga_game["runner"] == self.runner
  173                 ):
  174                     game = SteamGame.new_from_lutris_id(pga_game["id"])
  175                     game.uninstall()
  176                     removed_games.append(pga_game["id"])
  177         return (added_games, removed_games)
  178 
  179 
  180 SYNCER = SteamSyncer
  181
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/lutris/services/steam.py b/lutris/services/steam.py
  --- a/lutris/services/steam.py
  +++ b/lutris/services/steam.py
  @@ -20,6 +20,7 @@
       installer_slug = "steam"
       excluded_appids = [
           "228980",  # Steamworks Common Redistributables
  +        "1070560", # Steam Linux Runtime
       ]
   
       @classmethod
  
verification_info: {"golden_diff": "diff --git a/lutris/services/steam.py b/lutris/services/steam.py\n--- a/lutris/services/steam.py\n+++ b/lutris/services/steam.py\n@@ -20,6 +20,7 @@\n     installer_slug = \"steam\"\n     excluded_appids = [\n         \"228980\",  # Steamworks Common Redistributables\n+        \"1070560\", # Steam Linux Runtime\n     ]\n \n     @classmethod\n", "issue": "Don't show Steam Linux Runtime when importing games\nLink to the tool on steamdb: https://steamdb.info/app/1070560/\n", "before_files": [{"content": "\"\"\"Steam service\"\"\"\nimport os\nimport re\n\nfrom lutris import pga\nfrom lutris.config import make_game_config_id, LutrisConfig\nfrom lutris.util.steam.appmanifest import AppManifest, get_appmanifests\nfrom lutris.util.steam.config import get_steamapps_paths\nfrom lutris.services.service_game import ServiceGame\n\nNAME = \"Steam\"\nICON = \"steam\"\nONLINE = False\n\n\nclass SteamGame(ServiceGame):\n    \"\"\"ServiceGame for Steam games\"\"\"\n\n    store = \"steam\"\n    installer_slug = \"steam\"\n    excluded_appids = [\n        \"228980\",  # Steamworks Common Redistributables\n    ]\n\n    @classmethod\n    def new_from_steam_game(cls, appmanifest, game_id=None):\n        \"\"\"Return a Steam game instance from an AppManifest\"\"\"\n        steam_game = SteamGame()\n        steam_game.appid = str(appmanifest.steamid)\n        steam_game.game_id = game_id\n        steam_game.name = appmanifest.name\n        steam_game.slug = appmanifest.slug\n        steam_game.runner = appmanifest.get_runner_name()\n        return steam_game\n\n    @classmethod\n    def new_from_lutris_id(cls, game_id):\n        steam_game = SteamGame()\n        steam_game.game_id = game_id\n        return steam_game\n\n    @property\n    def config_id(self):\n        return make_game_config_id(self.slug)\n\n    @classmethod\n    def is_importable(cls, appmanifest):\n        \"\"\"Return whether a Steam game should be imported\"\"\"\n        if not appmanifest.is_installed():\n            return False\n        if appmanifest.steamid in cls.excluded_appids:\n            return False\n        if re.match(r\"^Proton \\d*\", appmanifest.name):\n            return False\n        return True\n\n    def install(self, updated_info=None):\n        \"\"\"Add an installed game to the library\n\n        Params:\n            updated_info (dict): Optional dictonary containing existing data not to overwrite\n        \"\"\"\n        if updated_info:\n            name = updated_info[\"name\"]\n            slug = updated_info[\"slug\"]\n        else:\n            name = self.name\n            slug = self.slug\n        self.game_id = pga.add_or_update(\n            id=self.game_id,\n            name=name,\n            runner=self.runner,\n            slug=slug,\n            steamid=int(self.appid),\n            installed=1,\n            configpath=self.config_id,\n            installer_slug=self.installer_slug,\n        )\n        self.create_config()\n        return self.game_id\n\n    def create_config(self):\n        \"\"\"Create the game configuration for a Steam game\"\"\"\n        game_config = LutrisConfig(\n            runner_slug=self.runner, game_config_id=self.config_id\n        )\n        game_config.raw_game_config.update({\"appid\": self.appid})\n        game_config.save()\n\n\nclass SteamSyncer:\n    platform = \"linux\"\n\n    def __init__(self):\n        self._lutris_games = None\n        self._lutris_steamids = None\n\n    @property\n    def runner(self):\n        return \"steam\" if self.platform == \"linux\" else \"winesteam\"\n\n    @property\n    def lutris_games(self):\n        if not self._lutris_games:\n            self._lutris_games = pga.get_games_where(\n                steamid__isnull=False, steamid__not=\"\"\n            )\n        return self._lutris_games\n\n    @property\n    def lutris_steamids(self):\n        if not self._lutris_steamids:\n            self._lutris_steamids = {str(game[\"steamid\"]) for game in self.lutris_games}\n        return self._lutris_steamids\n\n    def load(self, force_reload=False):\n        \"\"\"Return importable Steam games\"\"\"\n        games = []\n        steamapps_paths = get_steamapps_paths()\n        for steamapps_path in steamapps_paths[self.platform]:\n            for appmanifest_file in get_appmanifests(steamapps_path):\n                app_manifest = AppManifest(\n                    os.path.join(steamapps_path, appmanifest_file)\n                )\n                if SteamGame.is_importable(app_manifest):\n                    games.append(SteamGame.new_from_steam_game(app_manifest))\n        return games\n\n    def get_pga_game(self, game):\n        \"\"\"Return a PGA game if one is found\"\"\"\n        for pga_game in self.lutris_games:\n            if (\n                    str(pga_game[\"steamid\"]) == game.appid\n                    and (pga_game[\"runner\"] == self.runner or not pga_game[\"runner\"])\n                    and not pga_game[\"installed\"]\n            ):\n                return pga_game\n\n    def sync(self, games, full=False):\n        \"\"\"Syncs Steam games to Lutris\"\"\"\n        available_ids = set()  # Set of Steam appids seen while browsing AppManifests\n        added_games = []\n        for game in games:\n            steamid = game.appid\n            available_ids.add(steamid)\n            pga_game = self.get_pga_game(game)\n\n            if pga_game:\n                if (\n                    steamid in self.lutris_steamids\n                    and pga_game[\"installed\"] != 1\n                    and pga_game[\"installed\"]\n                ):\n                    added_games.append(game.install())\n\n            if steamid not in self.lutris_steamids:\n                added_games.append(game.install())\n            else:\n                if pga_game:\n                    added_games.append(game.install(pga_game))\n\n        if not full:\n            return added_games, games\n\n        removed_games = []\n        unavailable_ids = self.lutris_steamids.difference(available_ids)\n        for steamid in unavailable_ids:\n            for pga_game in self.lutris_games:\n                if (\n                    str(pga_game[\"steamid\"]) == steamid\n                    and pga_game[\"installed\"]\n                    and pga_game[\"runner\"] == self.runner\n                ):\n                    game = SteamGame.new_from_lutris_id(pga_game[\"id\"])\n                    game.uninstall()\n                    removed_games.append(pga_game[\"id\"])\n        return (added_games, removed_games)\n\n\nSYNCER = SteamSyncer\n", "path": "lutris/services/steam.py"}], "after_files": [{"content": "\"\"\"Steam service\"\"\"\nimport os\nimport re\n\nfrom lutris import pga\nfrom lutris.config import make_game_config_id, LutrisConfig\nfrom lutris.util.steam.appmanifest import AppManifest, get_appmanifests\nfrom lutris.util.steam.config import get_steamapps_paths\nfrom lutris.services.service_game import ServiceGame\n\nNAME = \"Steam\"\nICON = \"steam\"\nONLINE = False\n\n\nclass SteamGame(ServiceGame):\n    \"\"\"ServiceGame for Steam games\"\"\"\n\n    store = \"steam\"\n    installer_slug = \"steam\"\n    excluded_appids = [\n        \"228980\",  # Steamworks Common Redistributables\n        \"1070560\", # Steam Linux Runtime\n    ]\n\n    @classmethod\n    def new_from_steam_game(cls, appmanifest, game_id=None):\n        \"\"\"Return a Steam game instance from an AppManifest\"\"\"\n        steam_game = SteamGame()\n        steam_game.appid = str(appmanifest.steamid)\n        steam_game.game_id = game_id\n        steam_game.name = appmanifest.name\n        steam_game.slug = appmanifest.slug\n        steam_game.runner = appmanifest.get_runner_name()\n        return steam_game\n\n    @classmethod\n    def new_from_lutris_id(cls, game_id):\n        steam_game = SteamGame()\n        steam_game.game_id = game_id\n        return steam_game\n\n    @property\n    def config_id(self):\n        return make_game_config_id(self.slug)\n\n    @classmethod\n    def is_importable(cls, appmanifest):\n        \"\"\"Return whether a Steam game should be imported\"\"\"\n        if not appmanifest.is_installed():\n            return False\n        if appmanifest.steamid in cls.excluded_appids:\n            return False\n        if re.match(r\"^Proton \\d*\", appmanifest.name):\n            return False\n        return True\n\n    def install(self, updated_info=None):\n        \"\"\"Add an installed game to the library\n\n        Params:\n            updated_info (dict): Optional dictonary containing existing data not to overwrite\n        \"\"\"\n        if updated_info:\n            name = updated_info[\"name\"]\n            slug = updated_info[\"slug\"]\n        else:\n            name = self.name\n            slug = self.slug\n        self.game_id = pga.add_or_update(\n            id=self.game_id,\n            name=name,\n            runner=self.runner,\n            slug=slug,\n            steamid=int(self.appid),\n            installed=1,\n            configpath=self.config_id,\n            installer_slug=self.installer_slug,\n        )\n        self.create_config()\n        return self.game_id\n\n    def create_config(self):\n        \"\"\"Create the game configuration for a Steam game\"\"\"\n        game_config = LutrisConfig(\n            runner_slug=self.runner, game_config_id=self.config_id\n        )\n        game_config.raw_game_config.update({\"appid\": self.appid})\n        game_config.save()\n\n\nclass SteamSyncer:\n    platform = \"linux\"\n\n    def __init__(self):\n        self._lutris_games = None\n        self._lutris_steamids = None\n\n    @property\n    def runner(self):\n        return \"steam\" if self.platform == \"linux\" else \"winesteam\"\n\n    @property\n    def lutris_games(self):\n        if not self._lutris_games:\n            self._lutris_games = pga.get_games_where(\n                steamid__isnull=False, steamid__not=\"\"\n            )\n        return self._lutris_games\n\n    @property\n    def lutris_steamids(self):\n        if not self._lutris_steamids:\n            self._lutris_steamids = {str(game[\"steamid\"]) for game in self.lutris_games}\n        return self._lutris_steamids\n\n    def load(self, force_reload=False):\n        \"\"\"Return importable Steam games\"\"\"\n        games = []\n        steamapps_paths = get_steamapps_paths()\n        for steamapps_path in steamapps_paths[self.platform]:\n            for appmanifest_file in get_appmanifests(steamapps_path):\n                app_manifest = AppManifest(\n                    os.path.join(steamapps_path, appmanifest_file)\n                )\n                if SteamGame.is_importable(app_manifest):\n                    games.append(SteamGame.new_from_steam_game(app_manifest))\n        return games\n\n    def get_pga_game(self, game):\n        \"\"\"Return a PGA game if one is found\"\"\"\n        for pga_game in self.lutris_games:\n            if (\n                    str(pga_game[\"steamid\"]) == game.appid\n                    and (pga_game[\"runner\"] == self.runner or not pga_game[\"runner\"])\n                    and not pga_game[\"installed\"]\n            ):\n                return pga_game\n\n    def sync(self, games, full=False):\n        \"\"\"Syncs Steam games to Lutris\"\"\"\n        available_ids = set()  # Set of Steam appids seen while browsing AppManifests\n        added_games = []\n        for game in games:\n            steamid = game.appid\n            available_ids.add(steamid)\n            pga_game = self.get_pga_game(game)\n\n            if pga_game:\n                if (\n                    steamid in self.lutris_steamids\n                    and pga_game[\"installed\"] != 1\n                    and pga_game[\"installed\"]\n                ):\n                    added_games.append(game.install())\n\n            if steamid not in self.lutris_steamids:\n                added_games.append(game.install())\n            else:\n                if pga_game:\n                    added_games.append(game.install(pga_game))\n\n        if not full:\n            return added_games, games\n\n        removed_games = []\n        unavailable_ids = self.lutris_steamids.difference(available_ids)\n        for steamid in unavailable_ids:\n            for pga_game in self.lutris_games:\n                if (\n                    str(pga_game[\"steamid\"]) == steamid\n                    and pga_game[\"installed\"]\n                    and pga_game[\"runner\"] == self.runner\n                ):\n                    game = SteamGame.new_from_lutris_id(pga_game[\"id\"])\n                    game.uninstall()\n                    removed_games.append(pga_game[\"id\"])\n        return (added_games, removed_games)\n\n\nSYNCER = SteamSyncer\n", "path": "lutris/services/steam.py"}]}