3333
3434
3535class HeroicAmazonParser (BaseHeroicParser ):
36- """Parser for Amazon Games via Heroic/Nile ."""
36+ """Parser for Amazon Games."""
3737
3838 _RUNNER = "nile"
3939
@@ -47,41 +47,40 @@ def get_config_paths(self):
4747 return [_NATIVE , _FLATPAK ]
4848
4949 def read_games (self ):
50- # read installed Amazon games from nile config
51- data , cfg_path = self ._load_heroic_config_with_path ()
50+ # parse nile config
51+ data , cp = self ._load_heroic_config_with_path ()
5252
53- # amazon format is a plain array
5453 if not isinstance (data , list ):
5554 return []
5655
57- fp = self ._is_flatpak (cfg_path ) if cfg_path else False
58- games = []
56+ fp = self ._is_flatpak (cp ) if cp else False
57+ gs = []
5958
60- for entry in data :
61- if not isinstance (entry , dict ):
59+ for e in data :
60+ if not isinstance (e , dict ):
6261 continue
6362
64- aid = entry .get ("id" , "" )
65- ipath = entry .get ("path" , "" )
66- isize = entry .get ("size" , 0 )
67- if isinstance (isize , str ):
68- isize = 0
63+ aid = e .get ("id" , "" )
64+ ipath = e .get ("path" , "" )
65+ sz = e .get ("size" , 0 )
66+ if isinstance (sz , str ):
67+ sz = 0
6968
70- # name from path since theres no title field
69+ # name from path ( no title field)
7170 nm = Path (ipath ).name if ipath else aid
7271
7372 cmd = self ._build_heroic_launch_command (aid , fp )
7473
75- games .append (
74+ gs .append (
7675 ExternalGame (
7776 platform = self .platform_name (),
7877 platform_app_id = aid ,
7978 name = nm ,
8079 install_path = Path (ipath ) if ipath else None ,
8180 launch_command = cmd ,
82- install_size = isize ,
81+ install_size = sz ,
8382 )
8483 )
8584
86- logger .info ("found %d Amazon games via Heroic " % len (games ))
87- return games
85+ logger .info ("found %d Amazon games" % len (gs ))
86+ return gs
0 commit comments