Skip to content

Commit 98befb2

Browse files
committed
PlayState: Use Game Action Tracking Path as detection directory when set #596
1 parent a00a525 commit 98befb2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

source/Generic/PlayState/PlayState2.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,11 @@ private string GetGameDetectionDirectory(Game game, GameAction gameAction = null
241241
if (gameAction != null && !gameAction.Path.IsNullOrEmpty())
242242
{
243243
var expandedAction = PlayniteApi.ExpandGameVariables(game, gameAction);
244-
if (Path.IsPathRooted(expandedAction.Path))
244+
if (!expandedAction.TrackingPath.IsNullOrEmpty() && FileSystem.DirectoryExists(expandedAction.TrackingPath))
245+
{
246+
return expandedAction.TrackingPath;
247+
}
248+
else if (Path.IsPathRooted(expandedAction.Path))
245249
{
246250
return Path.GetDirectoryName(expandedAction.Path);
247251
}

0 commit comments

Comments
 (0)