Closed bobpaul closed 3 years ago
So if the doesn't go in a folder, it'll unpack fine with old versions, but (probably) not with TTS-Manager
.
If it goes in a folder, it'll unpack fine with old versions, but create a Thumbnails folder in the dest which Tabletop Simulator doesn't read.
Bumping the version in the pak
metadata doesn't affect the outcome since there's no assertion to prevent old apps from opening newer pak versions ¯\_(ツ)_/¯. so I guess my vote is include the folder, bump the version, and make the app warn if pak
metadata shows Ver > 2
to prevent against future format changes causing weird behavior.
As a user, I do not like that restored exports sometimes load in Tabletop Simulator showing a generic '?' instead of the author supplied thumbnail.
Background Workshop and Saves both consist of a
*.json
file as well as a like-named*.png
thumbnail. As a user, I would like thepak
file to include the thumbnail. This relates to #28 as TTS Mod Downloader provides this capability, and we should store thumbnails in the same fashion to ensure compatibility between the two applications.Path for JSON:
mods/workshop/{filename}.json
Path for Thumbnail:Mods/Workshop/Thumbnails/{filename}.png
Separating the thumbnail into a subfolder seems unnecessary to me, but it doesn't it cause any harm doing it this way, and it makes compatibility easier.
We should be able to handle 3 situations gracefully:
pak
file contains no thumbnail -- simply don't restore any thumbnail and log a Warningpak
file contains exactly 1 thumbnail (this is the normal case) -- restore the thumbnail, renaming if necessary so it matches the name of thejson
file.pak
file contains multiple thumbnails (this should not be valid) -- restore the thumbnail that has the same filename as the json, or -- restore the first thumbnail in the zip, renaming if necessary, and log a WarningIf the above 3 situations are handled, no change to the Meta data should be necessary unless old version of
TTS-Manager
would do the wrong thing in the presence of a Thumbnails sub folder in the zip. So this should be tested with a meta data version bump if necessary.