Skip to content

Commit

Permalink
Hack fix WindowQueueOptions assuming chat renders are always mp4 (#672)
Browse files Browse the repository at this point in the history
  • Loading branch information
ScrubN authored Apr 16, 2023
1 parent 74195d4 commit 454faac
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions TwitchDownloaderWPF/WindowQueueOptions.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,11 @@ private async void btnQueue_Click(object sender, RoutedEventArgs e)
if ((bool)checkRender.IsChecked && chatOptions.DownloadFormat == ChatFormat.Json)
{
ChatRenderTask renderTask = new ChatRenderTask();
ChatRenderOptions renderOptions = MainWindow.pageChatRender.GetOptions(Path.ChangeExtension(chatOptions.Filename.Replace(".gz", ""), ".mp4"));
ChatRenderOptions renderOptions = MainWindow.pageChatRender.GetOptions(Path.ChangeExtension(chatOptions.Filename.Replace(".gz", ""), '.' + MainWindow.pageChatRender.comboFormat.Text.ToLower()));
if (renderOptions.OutputFile.Trim() == downloadOptions.Filename.Trim())
{
//Just in case VOD and chat paths are the same. Like the previous defaults
renderOptions.OutputFile = Path.ChangeExtension(chatOptions.Filename.Replace(".gz", ""), " - CHAT.mp4");
renderOptions.OutputFile = Path.ChangeExtension(chatOptions.Filename.Replace(".gz", ""), " - CHAT." + MainWindow.pageChatRender.comboFormat.Text.ToLower());
}
renderOptions.InputFile = chatOptions.Filename;
renderTask.DownloadOptions = renderOptions;
Expand Down Expand Up @@ -241,11 +241,11 @@ private async void btnQueue_Click(object sender, RoutedEventArgs e)
if ((bool)checkRender.IsChecked && chatOptions.DownloadFormat == ChatFormat.Json)
{
ChatRenderTask renderTask = new ChatRenderTask();
ChatRenderOptions renderOptions = MainWindow.pageChatRender.GetOptions(Path.ChangeExtension(chatOptions.Filename.Replace(".gz", ""), ".mp4"));
ChatRenderOptions renderOptions = MainWindow.pageChatRender.GetOptions(Path.ChangeExtension(chatOptions.Filename.Replace(".gz", ""), '.' + MainWindow.pageChatRender.comboFormat.Text.ToLower()));
if (renderOptions.OutputFile.Trim() == downloadOptions.Filename.Trim())
{
//Just in case VOD and chat paths are the same. Like the previous defaults
renderOptions.OutputFile = Path.ChangeExtension(chatOptions.Filename.Replace(".gz", ""), " - CHAT.mp4");
renderOptions.OutputFile = Path.ChangeExtension(chatOptions.Filename.Replace(".gz", ""), " - CHAT." + MainWindow.pageChatRender.comboFormat.Text.ToLower());
}
renderOptions.InputFile = chatOptions.Filename;
renderTask.DownloadOptions = renderOptions;
Expand Down Expand Up @@ -294,7 +294,7 @@ private async void btnQueue_Click(object sender, RoutedEventArgs e)
if ((bool)checkRender.IsChecked && chatOptions.DownloadFormat == ChatFormat.Json)
{
ChatRenderTask renderTask = new ChatRenderTask();
ChatRenderOptions renderOptions = MainWindow.pageChatRender.GetOptions(Path.ChangeExtension(chatOptions.Filename.Replace(".gz", ""), ".mp4"));
ChatRenderOptions renderOptions = MainWindow.pageChatRender.GetOptions(Path.ChangeExtension(chatOptions.Filename.Replace(".gz", ""), '.' + MainWindow.pageChatRender.comboFormat.Text.ToLower()));
renderOptions.InputFile = chatOptions.Filename;
renderTask.DownloadOptions = renderOptions;
renderTask.Info.Title = chatPage.textTitle.Text;
Expand Down Expand Up @@ -467,11 +467,11 @@ private async void btnQueue_Click(object sender, RoutedEventArgs e)
if ((bool)checkRender.IsChecked && downloadOptions.DownloadFormat == ChatFormat.Json)
{
ChatRenderTask renderTask = new ChatRenderTask();
ChatRenderOptions renderOptions = MainWindow.pageChatRender.GetOptions(Path.ChangeExtension(downloadOptions.Filename.Replace(".gz", ""), ".mp4"));
ChatRenderOptions renderOptions = MainWindow.pageChatRender.GetOptions(Path.ChangeExtension(downloadOptions.Filename.Replace(".gz", ""), '.' + MainWindow.pageChatRender.comboFormat.Text.ToLower()));
if (renderOptions.OutputFile.Trim() == downloadOptions.Filename.Trim())
{
//Just in case VOD and chat paths are the same. Like the previous defaults
renderOptions.OutputFile = Path.ChangeExtension(downloadOptions.Filename.Replace(".gz", ""), " - CHAT.mp4");
renderOptions.OutputFile = Path.ChangeExtension(downloadOptions.Filename.Replace(".gz", ""), " - CHAT." + MainWindow.pageChatRender.comboFormat.Text.ToLower());
}
renderOptions.InputFile = downloadOptions.Filename;
renderTask.DownloadOptions = renderOptions;
Expand Down

0 comments on commit 454faac

Please sign in to comment.