diff --git a/docker-compose.yaml b/docker-compose.yaml index 1df6295..5996af5 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -18,6 +18,8 @@ services: volumes: - ./src:/opt/obsAPI/src - ./local/api-data:/data + - .migrations.js:/opt/obsAPI/.migrations.js + - ./migrations:/opt/obsAPI/migrations/ environment: - PORT=3000 - MONGODB_URL=mongodb://mongo/obsTest diff --git a/src/routes/api/tracks.js b/src/routes/api/tracks.js index ba33f86..8022cf5 100644 --- a/src/routes/api/tracks.js +++ b/src/routes/api/tracks.js @@ -248,6 +248,8 @@ router.put( track.uploadedByUserAgent = normalizeUserAgent(req.headers['user-agent']); await track.writeToOriginalFile(fileBody) + await track.rebuildTrackDataAndSave(); + } else if (track.visible && !track.publicTrackData) { await track.rebuildTrackDataAndSave(); } else { await track.save();