Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch vdf errors #470

Merged
merged 1 commit into from
Jan 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions CompactGUI/Helper.vb
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,18 @@ Module Helper
If Not parentfolder?.Name = "steamapps" Then Return Nothing

For Each fl In parentfolder.EnumerateFiles("*.acf").Where(Function(f) f.Length > 0)
Dim vConv = VdfConvert.Deserialize(File.ReadAllText(fl.FullName))
If vConv.Value.Item("installdir").ToString = workingDir.Name Then
Dim appID = CInt(vConv.Value.Item("appid").ToString)
Dim sName = vConv.Value.Item("name").ToString
Dim sInstallDir = vConv.Value.Item("installdir").ToString
Return (appID, sName, sInstallDir)
'TODO: Maybe add check to see when game was last updated?
End If
Try
Dim vConv = VdfConvert.Deserialize(File.ReadAllText(fl.FullName))
If vConv.Value.Item("installdir").ToString = workingDir.Name Then
Dim appID = CInt(vConv.Value.Item("appid").ToString)
Dim sName = vConv.Value.Item("name").ToString
Dim sInstallDir = vConv.Value.Item("installdir").ToString
Return (appID, sName, sInstallDir)
'TODO: Maybe add check to see when game was last updated?
End If
Catch
Debug.WriteLine($"VDF file unsupported: {fl.FullName}")
End Try
Next

Return Nothing
Expand Down