Migrate token to webp

This commit is contained in:
Vincent Vandemeulebrouck 2021-11-11 03:05:48 +01:00
parent 31d1d352f2
commit 2f66019a2a

View File

@ -276,7 +276,7 @@ async function migrationPngWebp_1_5_34() {
await Actor.updateDocuments(actorsUpdates); await Actor.updateDocuments(actorsUpdates);
game.actors.forEach(actor => { game.actors.forEach(actor => {
if (actor.data.token.img.match(regexOldPngJpg)){ if (actor.data.token.img.match(regexOldPngJpg)){
actor.update({ "data.token.img": convertImgToWebp(actor.data.token.img) }); actor.update({ "token.img": convertImgToWebp(actor.data.token.img) });
} }
const actorItemsToUpdate = prepareDocumentsImgUpdate(actor.items); const actorItemsToUpdate = prepareDocumentsImgUpdate(actor.items);
actor.updateEmbeddedDocuments('Item', actorItemsToUpdate); actor.updateEmbeddedDocuments('Item', actorItemsToUpdate);