Skip to content

Commit

Permalink
Only update embeds if the output format supports embeds
Browse files Browse the repository at this point in the history
  • Loading branch information
ScrubN committed Nov 28, 2023
1 parent 4faed79 commit fa95c9b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions TwitchDownloaderCore/ChatUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ public async Task UpdateAsync(IProgress<ProgressReport> progress, CancellationTo
int currentStep = 0;
int totalSteps = 2;
if (_updateOptions.CropBeginning || _updateOptions.CropEnding) totalSteps++;
if (_updateOptions.EmbedMissing || _updateOptions.ReplaceEmbeds) totalSteps++;
if (_updateOptions.OutputFormat is ChatFormat.Json or ChatFormat.Html
&& (_updateOptions.EmbedMissing || _updateOptions.ReplaceEmbeds)) totalSteps++;

currentStep++;
await UpdateVideoInfo(totalSteps, currentStep, progress, cancellationToken);
Expand All @@ -52,7 +53,8 @@ public async Task UpdateAsync(IProgress<ProgressReport> progress, CancellationTo
}

// If we are updating/replacing embeds
if (_updateOptions.EmbedMissing || _updateOptions.ReplaceEmbeds)
if (_updateOptions.OutputFormat is ChatFormat.Json or ChatFormat.Html
&& (_updateOptions.EmbedMissing || _updateOptions.ReplaceEmbeds))
{
currentStep++;
await UpdateEmbeds(currentStep, totalSteps, progress, cancellationToken);
Expand Down

0 comments on commit fa95c9b

Please sign in to comment.