Add - Added ScaleAndBorder to settings

Chg - Adjusted some log messages
This commit is contained in:
Elwador 2024-06-19 12:37:06 +02:00
parent f78df5b07f
commit d220a7d0db
6 changed files with 172 additions and 75 deletions

View File

@ -151,6 +151,7 @@ public class Crunchyroll{
CrunOptions.SelectedCalendarLanguage = "de"; CrunOptions.SelectedCalendarLanguage = "de";
CrunOptions.DlVideoOnce = true; CrunOptions.DlVideoOnce = true;
CrunOptions.StreamEndpoint = "web/firefox"; CrunOptions.StreamEndpoint = "web/firefox";
CrunOptions.SubsAddScaledBorder = ScaledBorderAndShadowSelection.ScaledBorderAndShadowYes;
CrunOptions.History = true; CrunOptions.History = true;
@ -1023,12 +1024,14 @@ public class Crunchyroll{
DownloadSpeed = 0, DownloadSpeed = 0,
Doing = "Decrypting" Doing = "Decrypting"
}; };
Queue.Refresh();
var assetIdRegexMatch = Regex.Match(chosenVideoSegments.segments[0].uri, @"/assets/(?:p/)?([^_,]+)"); var assetIdRegexMatch = Regex.Match(chosenVideoSegments.segments[0].uri, @"/assets/(?:p/)?([^_,]+)");
var assetId = assetIdRegexMatch.Success ? assetIdRegexMatch.Groups[1].Value : null; var assetId = assetIdRegexMatch.Success ? assetIdRegexMatch.Groups[1].Value : null;
var sessionId = Helpers.GenerateSessionId(); var sessionId = Helpers.GenerateSessionId();
Console.WriteLine("Decryption Needed, attempting to decrypt"); //TODO change back from error
Console.Error.WriteLine("Decryption Needed, attempting to decrypt");
if (!_widevine.canDecrypt){ if (!_widevine.canDecrypt){
dlFailed = true; dlFailed = true;
@ -1057,8 +1060,9 @@ public class Crunchyroll{
var decRequestResponse = await HttpClientReq.Instance.SendHttpRequest(decRequest); var decRequestResponse = await HttpClientReq.Instance.SendHttpRequest(decRequest);
if (!decRequestResponse.IsOk){ if (!decRequestResponse.IsOk){
Console.WriteLine("Request to DRM Authentication failed: "); Console.Error.WriteLine("Request to DRM Authentication failed: ");
MainWindow.Instance.ShowError("Request to DRM Authentication failed"); MainWindow.Instance.ShowError("Request to DRM Authentication failed");
dlFailed = true;
return new DownloadResponse{ return new DownloadResponse{
Data = files, Data = files,
Error = dlFailed, Error = dlFailed,
@ -1066,7 +1070,8 @@ public class Crunchyroll{
ErrorText = "DRM Authentication failed" ErrorText = "DRM Authentication failed"
}; };
} }
//TODO change back from error
Console.Error.WriteLine("Request to DRM Authentication successful");
DrmAuthData authData = Helpers.Deserialize<DrmAuthData>(decRequestResponse.ResponseContent, SettingsJsonSerializerSettings) ?? new DrmAuthData(); DrmAuthData authData = Helpers.Deserialize<DrmAuthData>(decRequestResponse.ResponseContent, SettingsJsonSerializerSettings) ?? new DrmAuthData();
@ -1076,7 +1081,8 @@ public class Crunchyroll{
var encryptionKeys = await _widevine.getKeys(chosenVideoSegments.pssh, "https://lic.drmtoday.com/license-proxy-widevine/cenc/", authDataDict); var encryptionKeys = await _widevine.getKeys(chosenVideoSegments.pssh, "https://lic.drmtoday.com/license-proxy-widevine/cenc/", authDataDict);
if (encryptionKeys.Count == 0){ if (encryptionKeys.Count == 0){
Console.WriteLine("Failed to get encryption keys"); Console.Error.WriteLine("Failed to get encryption keys");
dlFailed = true;
return new DownloadResponse{ return new DownloadResponse{
Data = files, Data = files,
Error = dlFailed, Error = dlFailed,
@ -1093,7 +1099,8 @@ public class Crunchyroll{
var commandAudio = commandBase + $" \"{tempTsFile}.audio.enc.m4s\" \"{tempTsFile}.audio.m4s\""; var commandAudio = commandBase + $" \"{tempTsFile}.audio.enc.m4s\" \"{tempTsFile}.audio.m4s\"";
if (videoDownloaded){ if (videoDownloaded){
Console.WriteLine("Started decrypting video"); //TODO change back from error
Console.Error.WriteLine("Started decrypting video");
var decryptVideo = await Helpers.ExecuteCommandAsync("mp4decrypt", CfgManager.PathMP4Decrypt, commandVideo); var decryptVideo = await Helpers.ExecuteCommandAsync("mp4decrypt", CfgManager.PathMP4Decrypt, commandVideo);
if (!decryptVideo.IsOk){ if (!decryptVideo.IsOk){
@ -1370,8 +1377,14 @@ public class Crunchyroll{
subsAssReqResponse.ResponseContent = '\ufeff' + subsAssReqResponse.ResponseContent; subsAssReqResponse.ResponseContent = '\ufeff' + subsAssReqResponse.ResponseContent;
var sBodySplit = subsAssReqResponse.ResponseContent.Split(new[]{ "\r\n" }, StringSplitOptions.None).ToList(); var sBodySplit = subsAssReqResponse.ResponseContent.Split(new[]{ "\r\n" }, StringSplitOptions.None).ToList();
// Insert 'ScaledBorderAndShadow: yes' after the second line // Insert 'ScaledBorderAndShadow: yes' after the second line
if (sBodySplit.Count > 2) if (sBodySplit.Count > 2){
sBodySplit.Insert(2, "ScaledBorderAndShadow: yes"); if (options.SubsAddScaledBorder == ScaledBorderAndShadowSelection.ScaledBorderAndShadowYes){
sBodySplit.Insert(2, "ScaledBorderAndShadow: yes");
}else if (options.SubsAddScaledBorder == ScaledBorderAndShadowSelection.ScaledBorderAndShadowNo){
sBodySplit.Insert(2, "ScaledBorderAndShadow: no");
}
}
// Rejoin the lines back into a single string // Rejoin the lines back into a single string
subsAssReqResponse.ResponseContent = string.Join("\r\n", sBodySplit); subsAssReqResponse.ResponseContent = string.Join("\r\n", sBodySplit);

View File

@ -165,6 +165,12 @@ public enum DownloadMediaType{
Subtitle, Subtitle,
} }
public enum ScaledBorderAndShadowSelection{
DontAdd,
ScaledBorderAndShadowYes,
ScaledBorderAndShadowNo,
}
public enum SonarrCoverType{ public enum SonarrCoverType{
Banner, Banner,
FanArt, FanArt,

View File

@ -59,21 +59,18 @@ public class Helpers{
return milliseconds + highResTimestamp; return milliseconds + highResTimestamp;
} }
public static void ConvertChapterFileForFFMPEG(string chapterFilePath) public static void ConvertChapterFileForFFMPEG(string chapterFilePath){
{
var chapterLines = File.ReadAllLines(chapterFilePath); var chapterLines = File.ReadAllLines(chapterFilePath);
var ffmpegChapterLines = new List<string> { ";FFMETADATA1" }; var ffmpegChapterLines = new List<string>{ ";FFMETADATA1" };
for (int i = 0; i < chapterLines.Length; i += 2) for (int i = 0; i < chapterLines.Length; i += 2){
{
var timeLine = chapterLines[i]; var timeLine = chapterLines[i];
var nameLine = chapterLines[i + 1]; var nameLine = chapterLines[i + 1];
var timeParts = timeLine.Split('='); var timeParts = timeLine.Split('=');
var nameParts = nameLine.Split('='); var nameParts = nameLine.Split('=');
if (timeParts.Length == 2 && nameParts.Length == 2) if (timeParts.Length == 2 && nameParts.Length == 2){
{
var startTime = TimeSpan.Parse(timeParts[1]).TotalMilliseconds; var startTime = TimeSpan.Parse(timeParts[1]).TotalMilliseconds;
var endTime = i + 2 < chapterLines.Length ? TimeSpan.Parse(chapterLines[i + 2].Split('=')[1]).TotalMilliseconds : startTime + 10000; var endTime = i + 2 < chapterLines.Length ? TimeSpan.Parse(chapterLines[i + 2].Split('=')[1]).TotalMilliseconds : startTime + 10000;
@ -89,37 +86,42 @@ public class Helpers{
} }
public static async Task<(bool IsOk, int ErrorCode)> ExecuteCommandAsync(string type, string bin, string command){ public static async Task<(bool IsOk, int ErrorCode)> ExecuteCommandAsync(string type, string bin, string command){
using (var process = new Process()){ try{
process.StartInfo.FileName = bin; using (var process = new Process()){
process.StartInfo.Arguments = command; process.StartInfo.FileName = bin;
process.StartInfo.RedirectStandardOutput = true; process.StartInfo.Arguments = command;
process.StartInfo.RedirectStandardError = true; process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.UseShellExecute = false; process.StartInfo.RedirectStandardError = true;
process.StartInfo.CreateNoWindow = true; process.StartInfo.UseShellExecute = false;
process.StartInfo.CreateNoWindow = true;
process.OutputDataReceived += (sender, e) => { process.OutputDataReceived += (sender, e) => {
if (!string.IsNullOrEmpty(e.Data)){ if (!string.IsNullOrEmpty(e.Data)){
Console.WriteLine(e.Data); Console.WriteLine(e.Data);
} }
}; };
process.ErrorDataReceived += (sender, e) => { process.ErrorDataReceived += (sender, e) => {
if (!string.IsNullOrEmpty(e.Data)){ if (!string.IsNullOrEmpty(e.Data)){
Console.WriteLine($"{e.Data}"); Console.WriteLine($"{e.Data}");
} }
}; };
process.Start(); process.Start();
process.BeginOutputReadLine(); process.BeginOutputReadLine();
process.BeginErrorReadLine(); process.BeginErrorReadLine();
await process.WaitForExitAsync(); await process.WaitForExitAsync();
// Define success condition more appropriately based on the application // Define success condition more appropriately based on the application
bool isSuccess = process.ExitCode == 0; bool isSuccess = process.ExitCode == 0;
return (IsOk: isSuccess, ErrorCode: process.ExitCode); return (IsOk: isSuccess, ErrorCode: process.ExitCode);
}
} catch (Exception ex){
Console.Error.WriteLine($"An error occurred: {ex.Message}");
return (IsOk: false, ErrorCode: -1);
} }
} }

View File

@ -53,6 +53,9 @@ public class CrDownloadOptions{
[YamlMember(Alias = "mux_skip_subs", ApplyNamingConventions = false)] [YamlMember(Alias = "mux_skip_subs", ApplyNamingConventions = false)]
public bool SkipSubsMux{ get; set; } public bool SkipSubsMux{ get; set; }
[YamlMember(Alias = "subs_add_scaled_border", ApplyNamingConventions = false)]
public ScaledBorderAndShadowSelection SubsAddScaledBorder{ get; set; }
[YamlMember(Alias = "mux_mp4", ApplyNamingConventions = false)] [YamlMember(Alias = "mux_mp4", ApplyNamingConventions = false)]
public bool Mp4{ get; set; } public bool Mp4{ get; set; }

View File

@ -32,6 +32,17 @@ public partial class SettingsPageViewModel : ViewModelBase{
[ObservableProperty] [ObservableProperty]
private bool _downloadChapters = true; private bool _downloadChapters = true;
[ObservableProperty]
private bool _addScaledBorderAndShadow = false;
[ObservableProperty]
private ComboBoxItem _selectedScaledBorderAndShadow;
public ObservableCollection<ComboBoxItem> ScaledBorderAndShadow{ get; } = new(){
new ComboBoxItem(){ Content = "ScaledBorderAndShadow: yes" },
new ComboBoxItem(){ Content = "ScaledBorderAndShadow: no" },
};
[ObservableProperty] [ObservableProperty]
private bool _muxToMp4; private bool _muxToMp4;
@ -296,6 +307,9 @@ public partial class SettingsPageViewModel : ViewModelBase{
SonarrPort = props.Port + ""; SonarrPort = props.Port + "";
SonarrApiKey = props.ApiKey + ""; SonarrApiKey = props.ApiKey + "";
} }
AddScaledBorderAndShadow = options.SubsAddScaledBorder is ScaledBorderAndShadowSelection.ScaledBorderAndShadowNo or ScaledBorderAndShadowSelection.ScaledBorderAndShadowYes;
SelectedScaledBorderAndShadow = GetScaledBorderAndShadowFromOptions(options);
DownloadVideo = !options.Novids; DownloadVideo = !options.Novids;
DownloadAudio = !options.Noaudio; DownloadAudio = !options.Noaudio;
@ -362,6 +376,7 @@ public partial class SettingsPageViewModel : ViewModelBase{
Crunchyroll.Instance.CrunOptions.Numbers = LeadingNumbers; Crunchyroll.Instance.CrunOptions.Numbers = LeadingNumbers;
Crunchyroll.Instance.CrunOptions.FileName = FileName; Crunchyroll.Instance.CrunOptions.FileName = FileName;
Crunchyroll.Instance.CrunOptions.SubsAddScaledBorder = GetScaledBorderAndShadowSelection();
List<string> softSubs = new List<string>(); List<string> softSubs = new List<string>();
foreach (var listBoxItem in SelectedSubLang){ foreach (var listBoxItem in SelectedSubLang){
@ -434,6 +449,35 @@ public partial class SettingsPageViewModel : ViewModelBase{
CfgManager.WriteSettingsToFile(); CfgManager.WriteSettingsToFile();
} }
private ScaledBorderAndShadowSelection GetScaledBorderAndShadowSelection(){
if (!AddScaledBorderAndShadow){
return ScaledBorderAndShadowSelection.DontAdd;
}
if (SelectedScaledBorderAndShadow.Content + "" == "ScaledBorderAndShadow: yes"){
return ScaledBorderAndShadowSelection.ScaledBorderAndShadowYes;
}
if (SelectedScaledBorderAndShadow.Content + "" == "ScaledBorderAndShadow: no"){
return ScaledBorderAndShadowSelection.ScaledBorderAndShadowNo;
}
return ScaledBorderAndShadowSelection.ScaledBorderAndShadowYes;
}
private ComboBoxItem GetScaledBorderAndShadowFromOptions(CrDownloadOptions options){
switch (options.SubsAddScaledBorder){
case (ScaledBorderAndShadowSelection.ScaledBorderAndShadowYes):
return ScaledBorderAndShadow.FirstOrDefault(a => a.Content != null && (string)a.Content == "ScaledBorderAndShadow: yes") ?? ScaledBorderAndShadow[0];
case ScaledBorderAndShadowSelection.ScaledBorderAndShadowNo:
return ScaledBorderAndShadow.FirstOrDefault(a => a.Content != null && (string)a.Content == "ScaledBorderAndShadow: no") ?? ScaledBorderAndShadow[0];
default:
return ScaledBorderAndShadow[0];
}
}
private void UpdateSubAndDubString(){ private void UpdateSubAndDubString(){
if (SelectedSubLang.Count == 0){ if (SelectedSubLang.Count == 0){
SelectedSubs = "none"; SelectedSubs = "none";
@ -626,6 +670,14 @@ public partial class SettingsPageViewModel : ViewModelBase{
partial void OnSelectedStreamEndpointChanged(ComboBoxItem value){ partial void OnSelectedStreamEndpointChanged(ComboBoxItem value){
UpdateSettings(); UpdateSettings();
} }
partial void OnAddScaledBorderAndShadowChanged(bool value){
UpdateSettings();
}
partial void OnSelectedScaledBorderAndShadowChanged(ComboBoxItem value){
UpdateSettings();
}
} }
public class MuxingParam{ public class MuxingParam{

View File

@ -45,7 +45,8 @@
</ToggleButton.Content> </ToggleButton.Content>
</ToggleButton> </ToggleButton>
<Popup IsLightDismissEnabled="True" <Popup IsLightDismissEnabled="True"
IsOpen="{Binding IsChecked, ElementName=DropdownButtonDub, Mode=TwoWay}" Placement="Bottom" IsOpen="{Binding IsChecked, ElementName=DropdownButtonDub, Mode=TwoWay}"
Placement="Bottom"
PlacementTarget="{Binding ElementName=DropdownButtonDub}"> PlacementTarget="{Binding ElementName=DropdownButtonDub}">
<Border BorderThickness="1" Background="{DynamicResource ComboBoxDropDownBackground}"> <Border BorderThickness="1" Background="{DynamicResource ComboBoxDropDownBackground}">
<ListBox x:Name="ListBoxDubsSelection" SelectionMode="Multiple,Toggle" Width="210" <ListBox x:Name="ListBoxDubsSelection" SelectionMode="Multiple,Toggle" Width="210"
@ -107,6 +108,18 @@
</StackPanel> </StackPanel>
</controls:SettingsExpander.Footer> </controls:SettingsExpander.Footer>
<controls:SettingsExpanderItem Content="Add ScaledBorderAndShadow ">
<controls:SettingsExpanderItem.Footer>
<StackPanel Orientation="Horizontal">
<ComboBox HorizontalContentAlignment="Center" IsVisible="{Binding AddScaledBorderAndShadow}" Margin="5 0" MinWidth="210" MaxDropDownHeight="400"
ItemsSource="{Binding ScaledBorderAndShadow}"
SelectedItem="{Binding SelectedScaledBorderAndShadow}">
</ComboBox>
<CheckBox IsChecked="{Binding AddScaledBorderAndShadow}"> </CheckBox>
</StackPanel>
</controls:SettingsExpanderItem.Footer>
</controls:SettingsExpanderItem>
</controls:SettingsExpander> </controls:SettingsExpander>
<controls:SettingsExpander Header="History" <controls:SettingsExpander Header="History"
@ -131,7 +144,7 @@
</ComboBox> </ComboBox>
</controls:SettingsExpanderItem.Footer> </controls:SettingsExpanderItem.Footer>
</controls:SettingsExpanderItem> </controls:SettingsExpanderItem>
<controls:SettingsExpanderItem Content="Simultaneous Downloads"> <controls:SettingsExpanderItem Content="Simultaneous Downloads">
<controls:SettingsExpanderItem.Footer> <controls:SettingsExpanderItem.Footer>
<controls:NumberBox Minimum="0" Maximum="5" <controls:NumberBox Minimum="0" Maximum="5"
@ -146,7 +159,7 @@
<CheckBox IsChecked="{Binding DownloadVideo}"> </CheckBox> <CheckBox IsChecked="{Binding DownloadVideo}"> </CheckBox>
</controls:SettingsExpanderItem.Footer> </controls:SettingsExpanderItem.Footer>
</controls:SettingsExpanderItem> </controls:SettingsExpanderItem>
<controls:SettingsExpanderItem Content="Download Video for every dub"> <controls:SettingsExpanderItem Content="Download Video for every dub">
<controls:SettingsExpanderItem.Footer> <controls:SettingsExpanderItem.Footer>
<CheckBox IsChecked="{Binding DownloadVideoForEveryDub}"> </CheckBox> <CheckBox IsChecked="{Binding DownloadVideoForEveryDub}"> </CheckBox>
@ -182,7 +195,7 @@
<CheckBox IsChecked="{Binding DownloadChapters}"> </CheckBox> <CheckBox IsChecked="{Binding DownloadChapters}"> </CheckBox>
</controls:SettingsExpanderItem.Footer> </controls:SettingsExpanderItem.Footer>
</controls:SettingsExpanderItem> </controls:SettingsExpanderItem>
<controls:SettingsExpander.Footer> <controls:SettingsExpander.Footer>
</controls:SettingsExpander.Footer> </controls:SettingsExpander.Footer>
</controls:SettingsExpander> </controls:SettingsExpander>
@ -226,13 +239,13 @@
<CheckBox IsChecked="{Binding MuxToMp4}"> </CheckBox> <CheckBox IsChecked="{Binding MuxToMp4}"> </CheckBox>
</controls:SettingsExpanderItem.Footer> </controls:SettingsExpanderItem.Footer>
</controls:SettingsExpanderItem> </controls:SettingsExpanderItem>
<controls:SettingsExpanderItem Content="Keep Subtitles separate"> <controls:SettingsExpanderItem Content="Keep Subtitles separate">
<controls:SettingsExpanderItem.Footer> <controls:SettingsExpanderItem.Footer>
<CheckBox IsChecked="{Binding SkipSubMux}"> </CheckBox> <CheckBox IsChecked="{Binding SkipSubMux}"> </CheckBox>
</controls:SettingsExpanderItem.Footer> </controls:SettingsExpanderItem.Footer>
</controls:SettingsExpanderItem> </controls:SettingsExpanderItem>
<controls:SettingsExpanderItem Content="Default Audio "> <controls:SettingsExpanderItem Content="Default Audio ">
<controls:SettingsExpanderItem.Footer> <controls:SettingsExpanderItem.Footer>
<ComboBox HorizontalContentAlignment="Center" MinWidth="210" MaxDropDownHeight="400" <ComboBox HorizontalContentAlignment="Center" MinWidth="210" MaxDropDownHeight="400"
@ -241,8 +254,8 @@
</ComboBox> </ComboBox>
</controls:SettingsExpanderItem.Footer> </controls:SettingsExpanderItem.Footer>
</controls:SettingsExpanderItem> </controls:SettingsExpanderItem>
<controls:SettingsExpanderItem Content="Default Subtitle "> <controls:SettingsExpanderItem Content="Default Subtitle ">
<controls:SettingsExpanderItem.Footer> <controls:SettingsExpanderItem.Footer>
<ComboBox HorizontalContentAlignment="Center" MinWidth="210" MaxDropDownHeight="400" <ComboBox HorizontalContentAlignment="Center" MinWidth="210" MaxDropDownHeight="400"
@ -251,15 +264,16 @@
</ComboBox> </ComboBox>
</controls:SettingsExpanderItem.Footer> </controls:SettingsExpanderItem.Footer>
</controls:SettingsExpanderItem> </controls:SettingsExpanderItem>
<controls:SettingsExpanderItem Content="Additional MKVMerge Options"> <controls:SettingsExpanderItem Content="Additional MKVMerge Options">
<controls:SettingsExpanderItem.Footer> <controls:SettingsExpanderItem.Footer>
<StackPanel> <StackPanel>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBox Name="TargetTextBox2" HorizontalAlignment="Left" MinWidth="250" <TextBox Name="TargetTextBox2" HorizontalAlignment="Left" MinWidth="250"
Text="{Binding MkvMergeOption }"></TextBox> Text="{Binding MkvMergeOption }">
</TextBox>
<Button HorizontalAlignment="Center" Margin="5 0" Command="{Binding AddMkvMergeParam}"> <Button HorizontalAlignment="Center" Margin="5 0" Command="{Binding AddMkvMergeParam}">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<controls:SymbolIcon Symbol="Add" FontSize="18" /> <controls:SymbolIcon Symbol="Add" FontSize="18" />
@ -274,20 +288,22 @@
</ItemsControl.ItemsPanel> </ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate> <ItemsControl.ItemTemplate>
<DataTemplate> <DataTemplate>
<Border BorderBrush="#4a4a4a" Background="#4a4a4a" BorderThickness="1" CornerRadius="10" Margin="2"> <Border BorderBrush="#4a4a4a" Background="#4a4a4a" BorderThickness="1"
CornerRadius="10" Margin="2">
<StackPanel Orientation="Horizontal" Margin="5"> <StackPanel Orientation="Horizontal" Margin="5">
<TextBlock Text="{Binding ParamValue}" Margin="5,0"/> <TextBlock Text="{Binding ParamValue}" Margin="5,0" />
<Button Content="X" FontSize="10" VerticalAlignment="Center" HorizontalAlignment="Center" Width="15" Height="15" Padding="0" <Button Content="X" FontSize="10" VerticalAlignment="Center"
Command="{Binding $parent[ItemsControl].((vm:SettingsPageViewModel)DataContext).RemoveMkvMergeParam}" CommandParameter="{Binding .}"/> HorizontalAlignment="Center" Width="15" Height="15" Padding="0"
Command="{Binding $parent[ItemsControl].((vm:SettingsPageViewModel)DataContext).RemoveMkvMergeParam}"
CommandParameter="{Binding .}" />
</StackPanel> </StackPanel>
</Border> </Border>
</DataTemplate> </DataTemplate>
</ItemsControl.ItemTemplate> </ItemsControl.ItemTemplate>
</ItemsControl> </ItemsControl>
</StackPanel> </StackPanel>
</controls:SettingsExpanderItem.Footer> </controls:SettingsExpanderItem.Footer>
</controls:SettingsExpanderItem> </controls:SettingsExpanderItem>
@ -295,8 +311,9 @@
<controls:SettingsExpanderItem.Footer> <controls:SettingsExpanderItem.Footer>
<StackPanel> <StackPanel>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBox HorizontalAlignment="Left" MinWidth="250" <TextBox HorizontalAlignment="Left" MinWidth="250"
Text="{Binding FfmpegOption }"></TextBox> Text="{Binding FfmpegOption }">
</TextBox>
<Button HorizontalAlignment="Center" Margin="5 0" Command="{Binding AddFfmpegParam}"> <Button HorizontalAlignment="Center" Margin="5 0" Command="{Binding AddFfmpegParam}">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<controls:SymbolIcon Symbol="Add" FontSize="18" /> <controls:SymbolIcon Symbol="Add" FontSize="18" />
@ -311,11 +328,14 @@
</ItemsControl.ItemsPanel> </ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate> <ItemsControl.ItemTemplate>
<DataTemplate> <DataTemplate>
<Border BorderBrush="#4a4a4a" Background="#4a4a4a" BorderThickness="1" CornerRadius="10" Margin="2"> <Border BorderBrush="#4a4a4a" Background="#4a4a4a" BorderThickness="1"
CornerRadius="10" Margin="2">
<StackPanel Orientation="Horizontal" Margin="5"> <StackPanel Orientation="Horizontal" Margin="5">
<TextBlock Text="{Binding ParamValue}" Margin="5,0"/> <TextBlock Text="{Binding ParamValue}" Margin="5,0" />
<Button Content="X" FontSize="10" VerticalAlignment="Center" HorizontalAlignment="Center" Width="15" Height="15" Padding="0" <Button Content="X" FontSize="10" VerticalAlignment="Center"
Command="{Binding $parent[ItemsControl].((vm:SettingsPageViewModel)DataContext).RemoveFfmpegParam}" CommandParameter="{Binding .}"/> HorizontalAlignment="Center" Width="15" Height="15" Padding="0"
Command="{Binding $parent[ItemsControl].((vm:SettingsPageViewModel)DataContext).RemoveFfmpegParam}"
CommandParameter="{Binding .}" />
</StackPanel> </StackPanel>
</Border> </Border>
</DataTemplate> </DataTemplate>
@ -329,7 +349,7 @@
</controls:SettingsExpander.Footer> </controls:SettingsExpander.Footer>
</controls:SettingsExpander> </controls:SettingsExpander>
<controls:SettingsExpander Header="Sonarr Settings" <controls:SettingsExpander Header="Sonarr Settings"
IconSource="Globe" IconSource="Globe"
Description="Adjust sonarr settings" Description="Adjust sonarr settings"
@ -338,37 +358,38 @@
<controls:SettingsExpanderItem Content="Host"> <controls:SettingsExpanderItem Content="Host">
<controls:SettingsExpanderItem.Footer> <controls:SettingsExpanderItem.Footer>
<TextBox HorizontalAlignment="Left" MinWidth="250" <TextBox HorizontalAlignment="Left" MinWidth="250"
Text="{Binding SonarrHost}" /> Text="{Binding SonarrHost}" />
</controls:SettingsExpanderItem.Footer> </controls:SettingsExpanderItem.Footer>
</controls:SettingsExpanderItem> </controls:SettingsExpanderItem>
<controls:SettingsExpanderItem Content="Port"> <controls:SettingsExpanderItem Content="Port">
<controls:SettingsExpanderItem.Footer> <controls:SettingsExpanderItem.Footer>
<TextBox HorizontalAlignment="Left" MinWidth="250" <TextBox HorizontalAlignment="Left" MinWidth="250"
Text="{Binding SonarrPort}" /> Text="{Binding SonarrPort}" />
</controls:SettingsExpanderItem.Footer> </controls:SettingsExpanderItem.Footer>
</controls:SettingsExpanderItem> </controls:SettingsExpanderItem>
<controls:SettingsExpanderItem Content="API Key"> <controls:SettingsExpanderItem Content="API Key">
<controls:SettingsExpanderItem.Footer> <controls:SettingsExpanderItem.Footer>
<TextBox HorizontalAlignment="Left" MinWidth="250" <TextBox HorizontalAlignment="Left" MinWidth="250"
Text="{Binding SonarrApiKey}" /> Text="{Binding SonarrApiKey}" />
</controls:SettingsExpanderItem.Footer> </controls:SettingsExpanderItem.Footer>
</controls:SettingsExpanderItem> </controls:SettingsExpanderItem>
<controls:SettingsExpanderItem Content="Use SSL"> <controls:SettingsExpanderItem Content="Use SSL">
<controls:SettingsExpanderItem.Footer> <controls:SettingsExpanderItem.Footer>
<CheckBox IsChecked="{Binding SonarrUseSsl}"> </CheckBox> <CheckBox IsChecked="{Binding SonarrUseSsl}"> </CheckBox>
</controls:SettingsExpanderItem.Footer> </controls:SettingsExpanderItem.Footer>
</controls:SettingsExpanderItem> </controls:SettingsExpanderItem>
<controls:SettingsExpanderItem Content="Use Sonarr Numbering" Description="Potentially wrong if it couldn't be matched"> <controls:SettingsExpanderItem Content="Use Sonarr Numbering"
Description="Potentially wrong if it couldn't be matched">
<controls:SettingsExpanderItem.Footer> <controls:SettingsExpanderItem.Footer>
<CheckBox IsChecked="{Binding SonarrUseSonarrNumbering}"> </CheckBox> <CheckBox IsChecked="{Binding SonarrUseSonarrNumbering}"> </CheckBox>
</controls:SettingsExpanderItem.Footer> </controls:SettingsExpanderItem.Footer>
</controls:SettingsExpanderItem> </controls:SettingsExpanderItem>
</controls:SettingsExpander> </controls:SettingsExpander>
<controls:SettingsExpander Header="App Theme" <controls:SettingsExpander Header="App Theme"
@ -546,7 +567,7 @@
</controls:SettingsExpander.Footer> </controls:SettingsExpander.Footer>
</controls:SettingsExpander> </controls:SettingsExpander>
<Grid Margin="0 0 0 10" <Grid Margin="0 0 0 10"
ColumnDefinitions="*,Auto" RowDefinitions="*,Auto"> ColumnDefinitions="*,Auto" RowDefinitions="*,Auto">