Closed EternalDeiwos closed 2 years ago
It's been a minute since I've worked with the logic of the pull command. I'll do some testing to see what the issue may be. Off the top of my head I suspect that it may be due to the strings in the biography key being escaped and / or URL encoded.
If you have time can you check the actor.db file that has the problem and see if the src attributes have been URL encoded?
OP means the journal entries in journal.db. The images are referenced inside html <img and <a tags. These are part of the JSON content attribute.
Ooops. My bad. Although, the URL encoding issue may still apply since the journal.db entries content attribute is also formatted HTML.
Regarding the renaming of assets, I was able to rename images within journal entries on my development server. If you have time please look in your db files to see if there may be additional encoding characters in the paths for the files that are not being renamed.
Regarding the pull command, currently it is only analyzing paths contained within json img keys. I see the need to also find paths contained throughout the db files so I'll start working on a more generic algorithm to detect and copy assets from other projects. No ETA but I expect to have a new version in the next few days.
Thanks for you feedback.
The journals.db
file looks like this within a JSON string:
<a title=\"A Very Special Asset\" href=\"assets/srd5e/img/adventure/myworld/My Asset.jpg\" target=\"_blank\" rel=\"noopener noreferrer\">
The double quotes are escaped because its in a JSON string but there is no URL encoding going on otherwise. Foundry seems to handle that on the client side and stores the raw HTML.
If you have time can you check the actor.db file that has the problem and see if the src attributes have been URL encoded?
We have already been using this for actors and have had no problems, but I am unsure if the actors in our current world had bios that would be affected by the above. A brief scan of the original actors.db
doesn't seem to show any of the same problem.
Also, much appreciated for fwt
as always.
I've pushed a new version that should allow pull of assets referenced anywhere in the database. Please test.
@EternalDeiwos, RE the rewrite of assets in the journal.db, is the path assets/srd5e/img/adventure/myworld/My Asset.jpg outside of the project being modified? If so, fwt will ignore remote assets as renaming them could result in breaking changes for those remote projects. Assuming that is the case pull should be able to make those assets local which would allow them to be renamed.
Let me know if all is working.
Regarding Pull, it worked for the world I was working on. It pulled journal links that it didn't do before, from a source external to the world, and placed it inside the world. Great Stuff.
Will test as well but glad to hear confirmation from electronicum.
Also, I had another occasion to try out fwt renameall
on journal content and found that it was in fact working as expected so false alarm there. With fwt pull
getting the files into the world path everything should work from there.
fwt pull
work great for the database files but don't pick up media references in journal entries.For example, we start with an element that looks like this:
The assets referenced in the journal are not moved, nor are the links updated. As an aside, I think that other commands like
fwt renameall
also do not affect journal media references but I'm not sure if that is because its not being scanned or its not meeting some condition to be renamed.