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

Fixed Cache-WindowsPlayer path retrieval from VRChat config.json #4

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

Conversation

Luois45
Copy link

@Luois45 Luois45 commented Apr 25, 2024

Fixes the path retrieval of the Cache-WindowsPlayer folder based on the VRChat config.json file.

Tested on Windows with all possible config cases
Couldn't test on Linux yet but should work.

@ShayBox
Copy link
Owner

ShayBox commented Apr 25, 2024

I don't believe the code needed to be fixed, it should work as tested on Windows and Linux since none of the code has changed since I tested it, but if it's not working for you, based on your code, I'm taking a guess that your config is malformed (possibly an extra/missing comma/quote) because your code defaults on malformed config instead of showing the error.

Without the deserialize method, if the path does get parsed from the config instead of defaulted from the lazy_static, and contains environment variables or relative paths, they won't get parsed and the PathBuf will contain an invalid path.

Could you share your config.json so I can test input with it?

EDIT: the load method also shouldn't contain the .join("Cache-WindowsPlayer") part because the path should already be the full parsed path to the config directory prior to attempting to load the path.

@Luois45
Copy link
Author

Luois45 commented Apr 25, 2024

It didn't work before. It works fine in VRChat. Thats what my config looked like.

{
	"cache_directory": "E:\\Games\\VRChat",
	"cache_size": 100
}

@ShayBox
Copy link
Owner

ShayBox commented Apr 25, 2024

I found that it was defaulting to the original path within the deserialize method because Deserialize::deserialize(deserializer) was trying to deserialize into a borrowed string, but because the path contains escaped backslashes it was failing, switching it to an explicit String and then borrowing that fixes the problem.

serde-rs/serde#1746

I must have either tested with forward slashes or had only copied my cache to another drive when testing, which means the default path still had files and appeared to work.

@ShayBox
Copy link
Owner

ShayBox commented Apr 25, 2024

Try this release and see if it works https://github.com/ShayBox/VRC-LOG/releases/tag/0.5.8

@ShayBox ShayBox force-pushed the master branch 5 times, most recently from 9230cf1 to 9bbe49f Compare May 24, 2024 20:51
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.

None yet

2 participants