Skip to content

Commit

Permalink
Fix missing file extension when enqueuing JSON chats with Gzip compre…
Browse files Browse the repository at this point in the history
…ssion (#1275)
  • Loading branch information
ScrubN authored Dec 26, 2024
1 parent 9bec730 commit b47ddc6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions TwitchDownloaderWPF/WindowQueueOptions.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,10 @@ private void btnQueue_Click(object sender, RoutedEventArgs e)
chatOptions.DownloadFormat = ChatFormat.Html;
else
chatOptions.DownloadFormat = ChatFormat.Text;
if (RadioCompressionGzip.IsChecked.GetValueOrDefault())
chatOptions.Compression = ChatCompression.Gzip;
chatOptions.EmbedData = checkEmbed.IsChecked.GetValueOrDefault();
chatOptions.Filename = Path.Combine(folderPath, Path.GetFileNameWithoutExtension(downloadOptions.Filename) + "." + chatOptions.DownloadFormat);
chatOptions.Filename = Path.Combine(folderPath, Path.GetFileNameWithoutExtension(downloadOptions.Filename) + "." + chatOptions.DownloadFormat + (chatOptions is { DownloadFormat: ChatFormat.Json, Compression: ChatCompression.Gzip } ? ".gz" : ""));
chatOptions.FileCollisionCallback = HandleFileCollisionCallback;

if (downloadOptions.TrimBeginning)
Expand Down Expand Up @@ -298,11 +300,13 @@ private void btnQueue_Click(object sender, RoutedEventArgs e)
chatOptions.DownloadFormat = ChatFormat.Html;
else
chatOptions.DownloadFormat = ChatFormat.Text;
if (RadioCompressionGzip.IsChecked.GetValueOrDefault())
chatOptions.Compression = ChatCompression.Gzip;
chatOptions.TimeFormat = TimestampFormat.Relative;
chatOptions.EmbedData = checkEmbed.IsChecked.GetValueOrDefault();
chatOptions.Filename = Path.Combine(folderPath, FilenameService.GetFilename(Settings.Default.TemplateChat, downloadTask.Info.Title, chatOptions.Id,
clipDownloadPage.currentVideoTime, clipDownloadPage.textStreamer.Text, clipDownloadPage.streamerId, TimeSpan.Zero, clipDownloadPage.clipLength,
clipDownloadPage.viewCount, clipDownloadPage.game, clipDownloadPage.clipperName, clipDownloadPage.clipId) + "." + chatOptions.FileExtension);
clipDownloadPage.viewCount, clipDownloadPage.game, clipDownloadPage.clipperName, clipDownloadPage.clipId) + "." + chatOptions.FileExtension + (chatOptions is { DownloadFormat: ChatFormat.Json, Compression: ChatCompression.Gzip } ? ".gz" : ""));
chatOptions.FileCollisionCallback = HandleFileCollisionCallback;

ChatDownloadTask chatTask = new ChatDownloadTask
Expand Down Expand Up @@ -380,7 +384,7 @@ private void btnQueue_Click(object sender, RoutedEventArgs e)
chatDownloadPage.streamerId,
chatOptions.TrimBeginning ? TimeSpan.FromSeconds(chatOptions.TrimBeginningTime) : TimeSpan.Zero,
chatOptions.TrimEnding ? TimeSpan.FromSeconds(chatOptions.TrimEndingTime) : chatDownloadPage.vodLength,
chatDownloadPage.viewCount, chatDownloadPage.game) + "." + chatOptions.FileExtension);
chatDownloadPage.viewCount, chatDownloadPage.game) + "." + chatOptions.FileExtension + (chatOptions is { DownloadFormat: ChatFormat.Json, Compression: ChatCompression.Gzip } ? ".gz" : ""));
chatOptions.FileCollisionCallback = HandleFileCollisionCallback;

ChatDownloadTask chatTask = new ChatDownloadTask
Expand Down

0 comments on commit b47ddc6

Please sign in to comment.