Skip to content

Commit

Permalink
Fix chats enqueued by the mass downloaders incorrectly having .json
Browse files Browse the repository at this point in the history
… file extension
  • Loading branch information
ScrubN committed Oct 10, 2023
1 parent 6d30324 commit 3f7b79e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions TwitchDownloaderWPF/WindowQueueOptions.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,9 @@ private void btnQueue_Click(object sender, RoutedEventArgs e)
chatOptions.DownloadFormat = ChatFormat.Text;
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, TimeSpan.Zero, clipDownloadPage.clipLength, clipDownloadPage.viewCount.ToString(), clipDownloadPage.game) + "." + chatOptions.FileExtension);
chatOptions.Filename = Path.Combine(folderPath, FilenameService.GetFilename(Settings.Default.TemplateChat, downloadTask.Info.Title, chatOptions.Id,
clipDownloadPage.currentVideoTime, clipDownloadPage.textStreamer.Text, TimeSpan.Zero, clipDownloadPage.clipLength,
clipDownloadPage.viewCount.ToString(), clipDownloadPage.game) + "." + chatOptions.FileExtension);

ChatDownloadTask chatTask = new ChatDownloadTask
{
Expand Down Expand Up @@ -313,7 +315,7 @@ private void btnQueue_Click(object sender, RoutedEventArgs e)

ChatDownloadOptions chatOptions = MainWindow.pageChatDownload.GetOptions(null);
chatOptions.Id = chatDownloadPage.downloadId;
chatOptions.Filename = Path.Combine(folderPath, FilenameService.GetFilename(Settings.Default.TemplateChat, chatDownloadPage.textTitle.Text, chatOptions.Id, chatDownloadPage.currentVideoTime, chatDownloadPage.textStreamer.Text,
chatOptions.Filename = Path.Combine(folderPath, FilenameService.GetFilename(Settings.Default.TemplateChat, chatDownloadPage.textTitle.Text, chatOptions.Id,chatDownloadPage.currentVideoTime, chatDownloadPage.textStreamer.Text,
chatOptions.CropBeginning ? TimeSpan.FromSeconds(chatOptions.CropBeginningTime) : TimeSpan.Zero,
chatOptions.CropEnding ? TimeSpan.FromSeconds(chatOptions.CropEndingTime) : chatDownloadPage.vodLength,
chatDownloadPage.viewCount.ToString(), chatDownloadPage.game) + "." + chatOptions.FileExtension);
Expand Down Expand Up @@ -533,16 +535,16 @@ private void EnqueueDataList()
CropBeginning = false,
CropEnding = false
};
downloadOptions.Filename = Path.Combine(folderPath, FilenameService.GetFilename(Settings.Default.TemplateChat, taskData.Title, taskData.Id, taskData.Time, taskData.Streamer,
downloadOptions.CropBeginning ? TimeSpan.FromSeconds(downloadOptions.CropBeginningTime) : TimeSpan.Zero,
downloadOptions.CropEnding ? TimeSpan.FromSeconds(downloadOptions.CropEndingTime) : TimeSpan.FromSeconds(taskData.Length),
taskData.Views.ToString(), taskData.Game) + "." + downloadOptions.FileExtension);
if (radioJson.IsChecked == true)
downloadOptions.DownloadFormat = ChatFormat.Json;
else if (radioHTML.IsChecked == true)
downloadOptions.DownloadFormat = ChatFormat.Html;
else
downloadOptions.DownloadFormat = ChatFormat.Text;
downloadOptions.Filename = Path.Combine(folderPath, FilenameService.GetFilename(Settings.Default.TemplateChat, taskData.Title, taskData.Id, taskData.Time, taskData.Streamer,
downloadOptions.CropBeginning ? TimeSpan.FromSeconds(downloadOptions.CropBeginningTime) : TimeSpan.Zero,
downloadOptions.CropEnding ? TimeSpan.FromSeconds(downloadOptions.CropEndingTime) : TimeSpan.FromSeconds(taskData.Length),
taskData.Views.ToString(), taskData.Game) + "." + downloadOptions.FileExtension);

ChatDownloadTask downloadTask = new ChatDownloadTask
{
Expand Down

0 comments on commit 3f7b79e

Please sign in to comment.