Skip to content

Commit

Permalink
Improve interludes recording mechanics
Browse files Browse the repository at this point in the history
  • Loading branch information
m-danya committed Apr 2, 2024
1 parent aec0581 commit 3eaa48e
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions frontend/src/components/RecordTimecodesComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,19 @@ const recordTimecode = () => {
};
const recordInterludeEnd = () => {
const endTime = audioPlayer.value.currentTime;
lyricsWithTimecodes.push({
line: "[Проигрыш]",
end_ts: endTime - startTime,
});
let interludeText = "[Проигрыш]";
let end_ts = audioPlayer.value.currentTime - startTime;
if (
lyricsWithTimecodes[lyricsWithTimecodes.length - 1]?.line !== interludeText
) {
lyricsWithTimecodes.push({
line: interludeText,
end_ts: end_ts,
});
} else {
// extend existing interlude
lyricsWithTimecodes[lyricsWithTimecodes.length - 1].end_ts = end_ts;
}
};
</script>
Expand Down

0 comments on commit 3eaa48e

Please sign in to comment.