fix: regenerate public track data when saving a track as visible
This commit is contained in:
parent
4a119a0fc9
commit
7fec413437
|
@ -18,6 +18,8 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- ./src:/opt/obsAPI/src
|
- ./src:/opt/obsAPI/src
|
||||||
- ./local/api-data:/data
|
- ./local/api-data:/data
|
||||||
|
- .migrations.js:/opt/obsAPI/.migrations.js
|
||||||
|
- ./migrations:/opt/obsAPI/migrations/
|
||||||
environment:
|
environment:
|
||||||
- PORT=3000
|
- PORT=3000
|
||||||
- MONGODB_URL=mongodb://mongo/obsTest
|
- MONGODB_URL=mongodb://mongo/obsTest
|
||||||
|
|
|
@ -248,6 +248,8 @@ router.put(
|
||||||
track.uploadedByUserAgent = normalizeUserAgent(req.headers['user-agent']);
|
track.uploadedByUserAgent = normalizeUserAgent(req.headers['user-agent']);
|
||||||
await track.writeToOriginalFile(fileBody)
|
await track.writeToOriginalFile(fileBody)
|
||||||
|
|
||||||
|
await track.rebuildTrackDataAndSave();
|
||||||
|
} else if (track.visible && !track.publicTrackData) {
|
||||||
await track.rebuildTrackDataAndSave();
|
await track.rebuildTrackDataAndSave();
|
||||||
} else {
|
} else {
|
||||||
await track.save();
|
await track.save();
|
||||||
|
|
Loading…
Reference in a new issue