Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ScrubN committed May 18, 2024
1 parent 8ff007c commit d647a7c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
4 changes: 2 additions & 2 deletions TwitchDownloaderCore/Chat/ChatJson.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ private static async Task<JsonDocument> GetJsonDocumentAsync(Stream stream, stri
}
}

#pragma warning disable CS0618
#pragma warning disable CS0618 // Type or member is obsolete
private static async Task UpgradeChatJson(ChatRoot chatRoot)
{
const int MAX_STREAM_LENGTH = 172_800; // 48 hours in seconds. https://help.twitch.tv/s/article/broadcast-guidelines
Expand Down Expand Up @@ -239,7 +239,7 @@ private static async Task UpgradeChatJson(ChatRoot chatRoot)
}
}
}
#pragma warning restore CS0618
#pragma warning restore CS0618 // Type or member is obsolete

/// <summary>
/// Asynchronously serializes a chat json file.
Expand Down
2 changes: 1 addition & 1 deletion TwitchDownloaderCore/Tools/FfmpegMetadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace TwitchDownloaderCore.Tools
{
// https://ffmpeg.org/ffmpeg-formats.html#Metadata-1
// https://ffmpeg.org/ffmpeg-formats.html#Metadata-2
public static class FfmpegMetadata
{
private const string LINE_FEED = "\u000A";
Expand Down
16 changes: 3 additions & 13 deletions TwitchDownloaderWPF/WindowSettings.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using TwitchDownloaderWPF.Models;
using TwitchDownloaderWPF.Properties;
using TwitchDownloaderWPF.Services;
using CheckComboBox = HandyControl.Controls.CheckComboBox;
using CheckComboBoxItem = HandyControl.Controls.CheckComboBoxItem;

namespace TwitchDownloaderWPF
Expand Down Expand Up @@ -70,20 +69,11 @@ private void Window_Initialized(object sender, EventArgs e)
}

// Setup culture dropdown
foreach (var culture in AvailableCultures.All)
{
ComboLocale.Items.Add(culture.NativeName);
}
var currentCulture = Settings.Default.GuiCulture;
var selectedIndex = AvailableCultures.All.Select((item, index) => (item, index))
.Where(x => x.item.Code == currentCulture)
.Select(x => x.index)
.DefaultIfEmpty(-1)
.First();

if (selectedIndex > -1)
foreach (var (culture, index) in AvailableCultures.All.Select((x, index) => (x, index)))
{
ComboLocale.SelectedIndex = selectedIndex;
ComboLocale.Items.Add(culture.NativeName);
if (culture.Code == currentCulture) ComboLocale.SelectedIndex = index;
}

ComboLogLevels.Items.Add(new CheckComboBoxItem { Content = Translations.Strings.LogLevelVerbose, Tag = LogLevel.Verbose });
Expand Down

0 comments on commit d647a7c

Please sign in to comment.