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

Update Steam.lua #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

jldjune
Copy link

@jldjune jldjune commented Sep 27, 2021

Modified functions to better pull data from Steams updated file system

Due to changes caused by Steams new download management system, Gamedrawer was no longer able to pull data for libraries
on other drives.

Modifications were made to main functions to properly collect needed information to allow application to function.

A function was also needed to filter duplicates from directory table to compensate for current bug. When steam updates, duplicate directories are occasionally created. While these have no noticeable effects on how Steam operates, if not filtered can create bugs in Gamedrawer.

Modified functions to better pull data from Steams updated file system

--if vdf file exists
if libVDFFile then

--iterate through all the lines
for line in libVDFFile:lines() do
local dirline = string.match(line,'^%s*"%d+"%s*"(.*)"') --match format for only lines with directories
local dirline = string.match(line,'%u%:\\\\%a+%d?') --match format for only lines with directories
Copy link

@i077 i077 Oct 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to match paths more than 1 directory deep (e.g. D:\Games\Steam). Instead, I'd suggest:

Suggested change
local dirline = string.match(line,'%u%:\\\\%a+%d?') --match format for only lines with directories
local dirline = string.match(line,'"(%u:.*\\.+)"') --match format for only lines with directories

This way, we greedily match from the drive letter to the last backslash, then include the last segment of the path (since that isn't terminated with a backslash).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants