@@ -47,30 +47,31 @@ public override IEnumerable<GameInfo> GetGames()
4747
4848 using ( var view = PlayniteApi . WebViews . CreateOffscreenView ( ) )
4949 {
50- foreach ( var oculusBasePath in oculusLibraryLocations )
50+ foreach ( var currentLibraryBasePath in oculusLibraryLocations )
5151 {
52- logger . Info ( $ "Processing Oculus library location { oculusBasePath } ") ;
52+ logger . Info ( $ "Processing Oculus library location { currentLibraryBasePath } ") ;
5353
54- foreach ( var manifest in GetOculusAppManifests ( oculusBasePath ) )
54+ foreach ( var manifest in GetOculusAppManifests ( currentLibraryBasePath ) )
5555 {
5656 logger . Info ( $ "Processing manifest { manifest . CanonicalName } { manifest . AppId } ") ;
5757
5858 try
5959 {
60- var executableFullPath = $@ "{ oculusBasePath } \Software\{ manifest . CanonicalName } \{ manifest . LaunchFile } ";
60+ var installationPath = $@ "{ currentLibraryBasePath } \Software\{ manifest . CanonicalName } ";
61+ var executableFullPath = $@ "{ installationPath } \{ manifest . LaunchFile } ";
6162
6263 // set a default name
6364 var executableName = Path . GetFileNameWithoutExtension ( executableFullPath ) ;
6465
65- var icon = $@ "{ oculusBasePath } \..\CoreData\Software\StoreAssets\{ manifest . CanonicalName } _assets\icon_image.jpg";
66+ var icon = $@ "{ currentLibraryBasePath } \..\CoreData\Software\StoreAssets\{ manifest . CanonicalName } _assets\icon_image.jpg";
6667
6768 if ( ! File . Exists ( icon ) )
6869 {
6970 logger . Debug ( $ "Oculus store icon missing from file system- reverting to executable icon") ;
7071 icon = executableFullPath ;
7172 }
7273
73- var backgroundImage = $@ "{ oculusBasePath } \..\CoreData\Software\StoreAssets\{ manifest . CanonicalName } _assets\cover_landscape_image_large.png";
74+ var backgroundImage = $@ "{ currentLibraryBasePath } \..\CoreData\Software\StoreAssets\{ manifest . CanonicalName } _assets\cover_landscape_image_large.png";
7475
7576 if ( ! File . Exists ( backgroundImage ) )
7677 {
@@ -92,6 +93,7 @@ public override IEnumerable<GameInfo> GetGames()
9293 Name = scrapedData ? . Name ?? executableName ,
9394 Description = scrapedData ? . Description ?? string . Empty ,
9495 GameId = manifest . AppId ,
96+ InstallDirectory = installationPath ,
9597 PlayAction = new GameAction
9698 {
9799 Type = GameActionType . File ,
@@ -142,21 +144,8 @@ private List<OculusManifest> GetOculusAppManifests(string oculusBasePath)
142144 }
143145
144146 var json = File . ReadAllText ( fileName ) ;
145-
146- if ( string . IsNullOrWhiteSpace ( json ) )
147- {
148- logger . Error ( $ "JSON file is empty ({ fileName } )") ;
149- continue ;
150- }
151-
152- var manifest = JsonConvert . DeserializeObject < OculusManifest > ( json ) ;
153-
154- if ( manifest == null )
155- {
156- logger . Error ( $ "Could not deserialise json ({ fileName } )") ;
157- }
158-
159- manifest . LaunchFile = manifest ? . LaunchFile ? . Replace ( "/" , @"\" ) ;
147+
148+ var manifest = OculusManifest . Parse ( json ) ;
160149
161150 manifests . Add ( manifest ) ;
162151 }
0 commit comments