Skip to content

Commit 3507ab7

Browse files
authored
Allow selecting 3rd party emotes when enqueuing from VOD/clip pages and task queue (#1540)
1 parent 2667dbd commit 3507ab7

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

TwitchDownloaderWPF/WindowQueueOptions.xaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,12 @@
6262
<RadioButton x:Name="RadioCompressionNone" IsEnabled="False" IsChecked="True" Content="{lex:Loc ChatCompressionNone}" HorizontalAlignment="Left" Margin="5,0,0,0" VerticalAlignment="Top" BorderBrush="{DynamicResource AppElementBorder}" Foreground="{DynamicResource AppText}"/>
6363
<RadioButton x:Name="RadioCompressionGzip" IsEnabled="False" Content="{lex:Loc ChatCompressionGzip}" HorizontalAlignment="Left" Margin="5,0,0,0" VerticalAlignment="Top" BorderBrush="{DynamicResource AppElementBorder}" Foreground="{DynamicResource AppText}"/>
6464
</StackPanel>
65-
<CheckBox x:Name="checkEmbed" IsEnabled="False" Content="{lex:Loc EmbedImages}" HorizontalAlignment="Left" Margin="5,5,0,0" VerticalAlignment="Top" Foreground="{DynamicResource AppText}" BorderBrush="{DynamicResource AppElementBorder}"/>
65+
<CheckBox x:Name="checkEmbed" IsEnabled="False" Content="{lex:Loc EmbedImages}" Checked="CheckEmbed_CheckedChanged" Unchecked="CheckEmbed_CheckedChanged" HorizontalAlignment="Left" Margin="5,5,0,0" VerticalAlignment="Top" Foreground="{DynamicResource AppText}" BorderBrush="{DynamicResource AppElementBorder}"/>
66+
<StackPanel x:Name="StackThirdPartyEmbed" Margin="5,5,0,0" Orientation="Horizontal">
67+
<CheckBox IsEnabled="False" x:Name="CheckBttvEmbed" Margin="0,0,10,0" Content="BTTV" BorderBrush="{DynamicResource AppElementBorder}" Foreground="{DynamicResource AppText}" />
68+
<CheckBox IsEnabled="False" x:Name="CheckFfzEmbed" Margin="0,0,10,0" Content="FFZ" BorderBrush="{DynamicResource AppElementBorder}" Foreground="{DynamicResource AppText}" />
69+
<CheckBox IsEnabled="False" x:Name="CheckStvEmbed" Margin="0,0,10,0" Content="7TV" BorderBrush="{DynamicResource AppElementBorder}" Foreground="{DynamicResource AppText}" />
70+
</StackPanel>
6671
<CheckBox x:Name="checkDelayChat" Content="{lex:Loc DelayDownload}" HorizontalAlignment="Left" Margin="5,5,0,0" VerticalAlignment="Top" BorderBrush="{DynamicResource AppElementBorder}" Foreground="{DynamicResource AppText}" IsEnabled="False" />
6772
</StackPanel>
6873
<CheckBox x:Name="checkRender" IsEnabled="False" Content="{lex:Loc RenderChat}" HorizontalAlignment="Left" Margin="0,8,0,0" VerticalAlignment="Top" BorderBrush="{DynamicResource AppElementBorder}" Foreground="{DynamicResource AppText}"/>

TwitchDownloaderWPF/WindowQueueOptions.xaml.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public WindowQueueOptions(Page page)
6161
RadioCompressionNone.Visibility = Visibility.Collapsed;
6262
RadioCompressionGzip.Visibility = Visibility.Collapsed;
6363
checkEmbed.Visibility = Visibility.Collapsed;
64+
StackThirdPartyEmbed.Visibility = Visibility.Collapsed;
6465
if (!chatPage.radioJson.IsChecked.GetValueOrDefault())
6566
{
6667
checkRender.IsChecked = false;
@@ -84,6 +85,7 @@ public WindowQueueOptions(Page page)
8485
RadioCompressionNone.Visibility = Visibility.Collapsed;
8586
RadioCompressionGzip.Visibility = Visibility.Collapsed;
8687
checkEmbed.Visibility = Visibility.Collapsed;
88+
StackThirdPartyEmbed.Visibility = Visibility.Collapsed;
8789
checkDelayChat.Visibility = Visibility.Collapsed;
8890
checkRender.Visibility = Visibility.Collapsed;
8991
}
@@ -100,6 +102,7 @@ public WindowQueueOptions(Page page)
100102
RadioCompressionNone.Visibility = Visibility.Collapsed;
101103
RadioCompressionGzip.Visibility = Visibility.Collapsed;
102104
checkEmbed.Visibility = Visibility.Collapsed;
105+
StackThirdPartyEmbed.Visibility = Visibility.Collapsed;
103106
checkDelayChat.Visibility = Visibility.Collapsed;
104107
checkRender.IsChecked = true;
105108
checkRender.IsEnabled = false;
@@ -203,6 +206,9 @@ private void btnQueue_Click(object sender, RoutedEventArgs e)
203206
if (RadioCompressionGzip.IsChecked.GetValueOrDefault() && chatOptions.DownloadFormat == ChatFormat.Json)
204207
chatOptions.Compression = ChatCompression.Gzip;
205208
chatOptions.EmbedData = checkEmbed.IsChecked.GetValueOrDefault();
209+
chatOptions.BttvEmotes = CheckBttvEmbed.IsChecked.GetValueOrDefault();
210+
chatOptions.FfzEmotes = CheckFfzEmbed.IsChecked.GetValueOrDefault();
211+
chatOptions.StvEmotes = CheckStvEmbed.IsChecked.GetValueOrDefault();
206212
chatOptions.DelayDownload = checkDelayChat.IsChecked.GetValueOrDefault();
207213
chatOptions.Filename = Path.Combine(folderPath, Path.GetFileNameWithoutExtension(downloadOptions.Filename) + chatOptions.FileExtension);
208214
chatOptions.FileCollisionCallback = HandleFileCollisionCallback;
@@ -335,6 +341,9 @@ private void btnQueue_Click(object sender, RoutedEventArgs e)
335341
chatOptions.Compression = ChatCompression.Gzip;
336342
chatOptions.TimeFormat = TimestampFormat.Relative;
337343
chatOptions.EmbedData = checkEmbed.IsChecked.GetValueOrDefault();
344+
chatOptions.BttvEmotes = CheckBttvEmbed.IsChecked.GetValueOrDefault();
345+
chatOptions.FfzEmotes = CheckFfzEmbed.IsChecked.GetValueOrDefault();
346+
chatOptions.StvEmotes = CheckStvEmbed.IsChecked.GetValueOrDefault();
338347
chatOptions.DelayDownload = checkDelayChat.IsChecked.GetValueOrDefault();
339348
chatOptions.Filename = Path.Combine(folderPath, FilenameService.GetFilename(Settings.Default.TemplateChat, downloadTask.Info.Title, chatOptions.Id,
340349
clipDownloadPage.currentVideoTime, clipDownloadPage.textStreamer.Text, clipDownloadPage.streamerId, TimeSpan.Zero, clipDownloadPage.clipLength, clipDownloadPage.clipLength,
@@ -673,6 +682,9 @@ private void EnqueueDataList()
673682
ChatDownloadOptions downloadOptions = new ChatDownloadOptions
674683
{
675684
EmbedData = checkEmbed.IsChecked.GetValueOrDefault(),
685+
BttvEmotes = CheckBttvEmbed.IsChecked.GetValueOrDefault(),
686+
FfzEmotes = CheckFfzEmbed.IsChecked.GetValueOrDefault(),
687+
StvEmotes = CheckStvEmbed.IsChecked.GetValueOrDefault(),
676688
TimeFormat = TimestampFormat.Relative,
677689
Id = taskData.Id,
678690
TrimBeginning = false,
@@ -770,6 +782,7 @@ private void checkChat_Checked(object sender, RoutedEventArgs e)
770782
radioTxt.IsEnabled = true;
771783
radioHTML.IsEnabled = true;
772784
checkEmbed.IsEnabled = true;
785+
CheckBttvEmbed.IsEnabled = CheckFfzEmbed.IsEnabled = CheckStvEmbed.IsEnabled = checkEmbed.IsChecked.GetValueOrDefault();
773786
checkDelayChat.IsEnabled = true;
774787
RadioCompressionNone.IsEnabled = true;
775788
RadioCompressionGzip.IsEnabled = true;
@@ -790,6 +803,7 @@ private void checkChat_Unchecked(object sender, RoutedEventArgs e)
790803
radioTxt.IsEnabled = false;
791804
radioHTML.IsEnabled = false;
792805
checkEmbed.IsEnabled = false;
806+
CheckBttvEmbed.IsEnabled = CheckFfzEmbed.IsEnabled = CheckStvEmbed.IsEnabled = false;
793807
checkDelayChat.IsEnabled = false;
794808
RadioCompressionNone.IsEnabled = false;
795809
RadioCompressionGzip.IsEnabled = false;
@@ -807,6 +821,7 @@ private void radioJson_Checked(object sender, RoutedEventArgs e)
807821
if (this.IsInitialized)
808822
{
809823
checkEmbed.IsEnabled = true;
824+
CheckBttvEmbed.IsEnabled = CheckFfzEmbed.IsEnabled = CheckStvEmbed.IsEnabled = checkEmbed.IsChecked.GetValueOrDefault();
810825
checkRender.IsEnabled = true;
811826
StackChatCompression.Visibility = Visibility.Visible;
812827
}
@@ -817,6 +832,7 @@ private void radioTxt_Checked(object sender, RoutedEventArgs e)
817832
if (this.IsInitialized)
818833
{
819834
checkEmbed.IsEnabled = false;
835+
CheckBttvEmbed.IsEnabled = CheckFfzEmbed.IsEnabled = CheckStvEmbed.IsEnabled = false;
820836
checkRender.IsEnabled = false;
821837
StackChatCompression.Visibility = Visibility.Collapsed;
822838
}
@@ -827,6 +843,7 @@ private void radioHTML_Checked(object sender, RoutedEventArgs e)
827843
if (this.IsInitialized)
828844
{
829845
checkEmbed.IsEnabled = true;
846+
CheckBttvEmbed.IsEnabled = CheckFfzEmbed.IsEnabled = CheckStvEmbed.IsEnabled = checkEmbed.IsChecked.GetValueOrDefault();
830847
checkRender.IsEnabled = false;
831848
StackChatCompression.Visibility = Visibility.Collapsed;
832849
}
@@ -862,5 +879,13 @@ private void ComboPreferredQuality_OnSelectionChanged(object sender, SelectionCh
862879
Settings.Default.PreferredQuality = preferredQuality;
863880
}
864881
}
882+
883+
private void CheckEmbed_CheckedChanged(object sender, RoutedEventArgs e)
884+
{
885+
if (!IsInitialized)
886+
return;
887+
888+
CheckBttvEmbed.IsEnabled = CheckFfzEmbed.IsEnabled = CheckStvEmbed.IsEnabled = checkEmbed.IsChecked.GetValueOrDefault();
889+
}
865890
}
866891
}

0 commit comments

Comments
 (0)