@vosjs/studio-core 0.15.0 → 0.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +15 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6044,14 +6044,19 @@ function copyLayout(from, to, opts = {}) {
|
|
|
6044
6044
|
const last = doc.segments.at(-1);
|
|
6045
6045
|
if (freeze && last) {
|
|
6046
6046
|
const own2 = (doc.freeze ?? []).filter(
|
|
6047
|
-
(f) => Math.abs(f.at - last.out) > 1e-9
|
|
6047
|
+
(f) => Math.abs(f.at - last.out) > 1e-9 || !sameMedia(f.media, last.media)
|
|
6048
6048
|
);
|
|
6049
6049
|
const taken = new Set(own2.map((f) => f.id));
|
|
6050
6050
|
let n = 0;
|
|
6051
6051
|
while (taken.has(`f${n}`)) n++;
|
|
6052
6052
|
doc.freeze = [
|
|
6053
6053
|
...own2,
|
|
6054
|
-
{
|
|
6054
|
+
{
|
|
6055
|
+
id: `f${n}`,
|
|
6056
|
+
at: last.out,
|
|
6057
|
+
seconds: freeze.seconds,
|
|
6058
|
+
...last.media ? { media: last.media } : {}
|
|
6059
|
+
}
|
|
6055
6060
|
].sort((a, b) => a.at - b.at);
|
|
6056
6061
|
doc.segments = doc.segments.map((s) => {
|
|
6057
6062
|
if (s.hold === void 0) return s;
|
|
@@ -6096,14 +6101,20 @@ function applyTemplate(template, take, opts) {
|
|
|
6096
6101
|
const lastSeg = doc.segments.at(-1);
|
|
6097
6102
|
if (tail && opts.at === "end" && lastSeg) {
|
|
6098
6103
|
const own2 = (doc.freeze ?? []).filter(
|
|
6099
|
-
(f) => Math.abs(f.at - lastSeg.out) > 1e-9
|
|
6104
|
+
(f) => Math.abs(f.at - lastSeg.out) > 1e-9 || !sameMedia(f.media, lastSeg.media)
|
|
6100
6105
|
);
|
|
6101
6106
|
const taken = new Set(own2.map((f) => f.id));
|
|
6102
6107
|
let n = 0;
|
|
6103
6108
|
while (taken.has(`f${n}`)) n++;
|
|
6104
6109
|
doc.freeze = [
|
|
6105
6110
|
...own2,
|
|
6106
|
-
{
|
|
6111
|
+
{
|
|
6112
|
+
id: `f${n}`,
|
|
6113
|
+
at: lastSeg.out,
|
|
6114
|
+
seconds: tail.seconds,
|
|
6115
|
+
from,
|
|
6116
|
+
...lastSeg.media ? { media: lastSeg.media } : {}
|
|
6117
|
+
}
|
|
6107
6118
|
].sort((a, b) => a.at - b.at);
|
|
6108
6119
|
}
|
|
6109
6120
|
const templateEnd = totalDuration4(ratedSegments(template));
|