Skip to content

Commit

Permalink
show export progress quicker
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinoffers committed Dec 17, 2024
1 parent df4d4d6 commit 84fc40f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
3 changes: 2 additions & 1 deletion app/i18n/en-US/highlighter.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,5 +142,6 @@
"Export Horizontal": "Export Horizontal",
"Get highlights (Fortnite only)": "Get highlights (Fortnite only)",
"My Stream Highlights": "My Stream Highlights",
"You cannot use special characters in this field": "You cannot use special characters in this field"
"You cannot use special characters in this field": "You cannot use special characters in this field",
"Please select at least one clip to export a video": "Please select at least one clip to export a video"
}
18 changes: 12 additions & 6 deletions app/services/highlighter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1328,7 +1328,13 @@ export class HighlighterService extends PersistentStatefulService<IHighlighterSt
console.error('Highlighter: Cannot export until current export operation is finished');
return;
}

this.SET_EXPORT_INFO({
exporting: true,
currentFrame: 0,
step: EExportStep.AudioMix,
cancelRequested: false,
error: null,
});
let renderingClips: RenderingClip[] = [];
if (streamId) {
renderingClips = this.getClips(this.views.clips, streamId)
Expand Down Expand Up @@ -1407,6 +1413,11 @@ export class HighlighterService extends PersistentStatefulService<IHighlighterSt

if (!renderingClips.length) {
console.error('Highlighter: Export called without any clips!');
this.SET_EXPORT_INFO({
exporting: false,
exported: false,
error: $t('Please select at least one clip to export a video'),
});
return;
}

Expand All @@ -1419,12 +1430,7 @@ export class HighlighterService extends PersistentStatefulService<IHighlighterSt
const totalFramesAfterTransitions = totalFrames - numTransitions * transitionFrames;

this.SET_EXPORT_INFO({
exporting: true,
currentFrame: 0,
totalFrames: totalFramesAfterTransitions,
step: EExportStep.AudioMix,
cancelRequested: false,
error: null,
});

let fader: AudioCrossfader | null = null;
Expand Down

0 comments on commit 84fc40f

Please sign in to comment.