Compare commits
7 commits
2515d61f80
...
99a2522d50
Author | SHA1 | Date | |
---|---|---|---|
99a2522d50 | |||
5e9334e498 | |||
775802269e | |||
7cfb165881 | |||
85e37ce110 | |||
c260500060 | |||
1125eefefe |
1 changed files with 4 additions and 4 deletions
|
@ -20,14 +20,14 @@ import { getGame } from "../utils/utils.js";
|
||||||
* @returns {Promise<void>} A promise that resolves once the migration is complete
|
* @returns {Promise<void>} A promise that resolves once the migration is complete
|
||||||
*/
|
*/
|
||||||
export async function migrateCollection(collection, migrateDocument) {
|
export async function migrateCollection(collection, migrateDocument) {
|
||||||
const { documentName } = collection.constructor;
|
const { documentType } = collection.constructor;
|
||||||
for (const document of collection) {
|
for (const document of collection) {
|
||||||
logger.info(`Migrating ${documentName} document ${document.name} (${document.id})`);
|
logger.info(`Migrating ${documentType} document ${document.name} (${item.id})`);
|
||||||
try {
|
try {
|
||||||
await migrateDocument(document);
|
await migrateDocument(document);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
logger.error(
|
logger.error(
|
||||||
`Error during migration of ${documentName} document ${document.name} (${document.id}), continuing anyways.`,
|
`Error during migration of ${documentType} document ${document.name} (${document.id}), continuing anyways.`,
|
||||||
err,
|
err,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ export function getSceneMigrator(migrateActor) {
|
||||||
return async (scene) => {
|
return async (scene) => {
|
||||||
if (migrateActor) {
|
if (migrateActor) {
|
||||||
for (const token of scene.tokens) {
|
for (const token of scene.tokens) {
|
||||||
if (!token.actorLink && token.actor) {
|
if (!token.actorLink) {
|
||||||
await migrateActor(token.actor);
|
await migrateActor(token.actor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue