fix(foundry): copy playlists before deleting the unpacked archive
Archive import removed the temp folder before playlist tracks were read, so zip imports with music failed. The dialog hint now names .zip / .fvtt instead of .world. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -108,6 +108,7 @@ import {
|
||||
buildProjectFromFoundryDocuments,
|
||||
loadFoundryDocumentsForImport,
|
||||
type FoundryImportProgress,
|
||||
type FoundryPendingAppPlaylist,
|
||||
} from '../foundry/foundryImport';
|
||||
import { getAppSemanticVersion } from '../versionInfo';
|
||||
|
||||
@@ -2129,7 +2130,8 @@ export class ZipProjectStore {
|
||||
async importProjectFromFoundry(
|
||||
sourcePath: string,
|
||||
onProgress?: (p: FoundryImportProgress) => void,
|
||||
): Promise<{ project: Project; pendingAppPlaylists: import('../foundry/foundryImport').FoundryPendingAppPlaylist[] }> {
|
||||
importPlaylists?: (lists: FoundryPendingAppPlaylist[]) => Promise<void>,
|
||||
): Promise<{ project: Project; pendingAppPlaylists: FoundryPendingAppPlaylist[] }> {
|
||||
await this.ensureRoots();
|
||||
const loaded = await loadFoundryDocumentsForImport(sourcePath, onProgress);
|
||||
try {
|
||||
@@ -2159,6 +2161,10 @@ export class ZipProjectStore {
|
||||
await this.writeCacheProject(cacheDir, project);
|
||||
onProgress?.({ stage: 'zip', percent: 90, detail: 'Сборка проекта…' });
|
||||
await this.enqueuePack(cacheDir, zipPath);
|
||||
// Архив распакован во временную папку. Плейлисты читают её по absPath — копировать до cleanup.
|
||||
if (importPlaylists && pendingAppPlaylists.length > 0) {
|
||||
await importPlaylists(pendingAppPlaylists);
|
||||
}
|
||||
onProgress?.({ stage: 'done', percent: 100, detail: 'Готово' });
|
||||
return { project: this.openProject.project, pendingAppPlaylists };
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user