Пример #1
0
    def load(self):
        """Return importable Steam games"""
        if self.is_loading:
            logger.warning("Steam games are already loading")
            return
        self.is_loading = True
        self.emit("service-games-load")

        steam_dir = get_steam_dir()

        for steam_game in get_steam_library(get_user_steam_id(steam_dir)):
            game = SteamGame.new_from_steam_game(steam_game)
            game.save()

        self.match_games()
        self.is_loading = False
        logger.debug("Steam games loaded")
        self.emit("service-games-loaded")
Пример #2
0
 def load(self):
     """Return importable Steam games"""
     if self.is_loading:
         logger.warning("Steam games are already loading")
         return
     self.is_loading = True
     steamid = get_user_steam_id()
     if not steamid:
         logger.error("Unable to find SteamID from Steam config")
         return
     steam_games = get_steam_library(steamid)
     if not steam_games:
         raise RuntimeError(_("Failed to load games. Check that your profile is set to public during the sync."))
     for steam_game in steam_games:
         if steam_game["appid"] in self.excluded_appids:
             continue
         game = self.game_class.new_from_steam_game(steam_game)
         game.save()
     self.match_games()
     self.is_loading = False
     return steam_games
Пример #3
0
    def load(self):
        """Return importable Steam games"""
        if self.is_loading:
            logger.warning("Steam games are already loading")
            return
        self.is_loading = True
        self.emit("service-games-load")

        steamid = get_user_steam_id()
        if not steamid:
            logger.error("Unable to find SteamID from Steam config")
            self.emit("service-games-loaded")
            return
        steam_games = get_steam_library(steamid)
        for steam_game in steam_games:
            game = SteamGame.new_from_steam_game(steam_game)
            game.save()

        self.match_games()
        self.is_loading = False
        logger.debug("%d Steam games loaded", len(steam_games))
        self.emit("service-games-loaded")
        return steam_games