@@ -15,9 +15,11 @@ impl LutrisPlatform {
15
15
fn get_shortcuts ( & self ) -> eyre:: Result < Vec < LutrisGame > > {
16
16
let output = get_lutris_command_output ( & self . settings ) ?;
17
17
let games = parse_lutris_games ( output. as_str ( ) ) ;
18
+ let installed = self . settings . installed ;
18
19
let mut res = vec ! [ ] ;
19
20
for mut game in games {
20
- if game. service != "steam" {
21
+ let service = if installed { game. runner . clone ( ) . unwrap_or_default ( ) } else { game. service . clone ( ) . unwrap_or_default ( ) } ;
22
+ if service != "steam" {
21
23
game. settings = Some ( self . settings . clone ( ) ) ;
22
24
res. push ( game) ;
23
25
}
@@ -32,16 +34,12 @@ fn get_lutris_command_output(settings: &LutrisSettings) -> eyre::Result<String>
32
34
#[ cfg( not( feature = "flatpak" ) ) ]
33
35
{
34
36
let mut command = Command :: new ( "flatpak" ) ;
35
- command
36
- . arg ( "run" )
37
- . arg ( flatpak_image)
38
- . arg ( "-a" )
39
- . arg ( "--json" ) ;
40
- if settings. installed {
41
- command. arg ( "-o" ) . output ( ) ?
42
- } else {
43
- command. output ( ) ?
44
- }
37
+ command. arg ( "run" ) . arg ( flatpak_image) . arg ( "--json" ) ;
38
+ if settings. installed {
39
+ command. arg ( "-lo" ) . output ( ) ?
40
+ } else {
41
+ command. arg ( "-a" ) . output ( ) ?
42
+ }
45
43
}
46
44
#[ cfg( feature = "flatpak" ) ]
47
45
{
@@ -50,22 +48,21 @@ fn get_lutris_command_output(settings: &LutrisSettings) -> eyre::Result<String>
50
48
. arg ( "--host" )
51
49
. arg ( "flatpak" )
52
50
. arg ( "run" )
53
- . arg ( flatpak_image)
54
- . arg ( "-a" )
55
- . arg ( "--json" ) ;
56
- if settings. installed {
57
- command. arg ( "-o" ) . output ( ) ?
58
- } else {
59
- command. output ( ) ?
60
- }
51
+ . arg ( flatpak_image) ;
52
+ command. arg ( "run" ) . arg ( flatpak_image) . arg ( "--json" ) ;
53
+ if settings. installed {
54
+ command. arg ( "-lo" ) . output ( ) ?
55
+ } else {
56
+ command. arg ( "-a" ) . output ( ) ?
57
+ }
61
58
}
62
59
} else {
63
60
let mut command = Command :: new ( & settings. executable ) ;
64
- command. arg ( "-a" ) . arg ( "- -json") ;
61
+ command. arg ( "--json" ) ;
65
62
if settings. installed {
66
- command. arg ( "-o " ) . output ( ) ?
63
+ command. arg ( "-lo " ) . output ( ) ?
67
64
} else {
68
- command. output ( ) ?
65
+ command. arg ( "-a" ) . output ( ) ?
69
66
}
70
67
} ;
71
68
0 commit comments