tralph3 / Steam-Metadata-Editor

An easy to use GUI that edits the metadata of your Steam Apps
GNU General Public License v3.0
161 stars 18 forks source link

Convert appinfo.vdf to json #5

Open gitacct5 opened 2 years ago

gitacct5 commented 2 years ago

Hello! Is there a way to convert the entire appinfo.vdf (not only the modified apps) to json format file? Thanks!

tralph3 commented 2 years ago

Yes, this is in fact what the program does. It converts everything to JSON (that's the tiny pause before it opens up) and all the modifications you make, and all the data you see are changed/fetched from this JSON.

However, this is stored in memory, it never gets written to a file. Only the parts of the JSON that were modified are written to a file.

I fail to see why would you want access to the entire JSON.

gitacct5 commented 2 years ago

I think having access to the entire JSON will allow searching (for certain keywords in apps' name, publisher name, tag, etc.) and batch renaming/replacing. This would be helpful if an app has tons of DLCs and a user wants to make changes to the app itself and all its DLCs. Just a thought...

tralph3 commented 2 years ago

I see.

There's a problem tho: If the program were to dump all the data into a JSON file, for you to edit and then load back, then the program would need to read all the data from the JSON and somehow identify what has been modified (you can't do this easily). That's why the modifications.json file contains only the modifications, so the program knows how to handle them.

When the program starts, it generates the JSON from the appinfo.vdf file, and then it replaces the game entries in the JSON with the data inside the modifications.json file. Having to essentially recreate the entire file, while doable, would be extremely inneficient for a tiny ammount of modifications.

I may think of way to group together applications with their DLC. If that info can be found in appinfo.vdf, then it should be possible to do. As for doing it massively, that may require more work, but I don't see a reason for it to not be possible. I would probably have to redesign some stuff tho.