From 927358d31009b6f53d97215cfceb5bd65f72c8de Mon Sep 17 00:00:00 2001 From: niksedk Date: Wed, 17 Nov 2021 10:21:33 +0100 Subject: [PATCH] Minor fixes --- LanguageMaster.xml | 2 +- src/libse/Common/HtmlUtil.cs | 24 +++++++++++++++++++----- src/ui/Forms/DownloadYouTubeDl.cs | 12 ++++++------ src/ui/Logic/Language.cs | 2 +- 4 files changed, 27 insertions(+), 13 deletions(-) diff --git a/LanguageMaster.xml b/LanguageMaster.xml index 06af98adf..f0a7b31df 100644 --- a/LanguageMaster.xml +++ b/LanguageMaster.xml @@ -1357,7 +1357,7 @@ To use an API key go to "Options -> Settings -> Tools" to enter your Googl Apply custom override tags... Set position... Generate progress bar... - Change script resolution... + Change ASSA script resolution... Fix common errors in selected lines... Change casing for selected lines... Save selected lines as... diff --git a/src/libse/Common/HtmlUtil.cs b/src/libse/Common/HtmlUtil.cs index 8c56c8bd5..a0b43f8c1 100644 --- a/src/libse/Common/HtmlUtil.cs +++ b/src/libse/Common/HtmlUtil.cs @@ -897,11 +897,25 @@ namespace Nikse.SubtitleEdit.Core.Common text = text.Replace("", string.Empty); text = text.Replace("", string.Empty); - text = text.Replace(" ", " "); - text = text.Replace(" ", " "); - text = text.Replace(" ", " "); - text = text.Replace(" ", " "); - text = text.Replace(" ", " "); + if (!text.Contains('@')) + { + text = text.Replace(" ", "@"); + text = text.Replace(" ", "@"); + text = text.Replace(" ", "@"); + text = text.Replace("@ ", " "); + text = text.Replace("@ ", " "); + text = text.Replace(" @", " "); + text = text.Replace(" @", " "); + text = text.Replace("@", " "); + } + else + { + text = text.Replace(" ", " "); + text = text.Replace(" ", " "); + text = text.Replace(" ", " "); + text = text.Replace(" ", " "); + text = text.Replace(" ", " "); + } return preTags + text; } diff --git a/src/ui/Forms/DownloadYouTubeDl.cs b/src/ui/Forms/DownloadYouTubeDl.cs index 8ca3b303f..d3b4db505 100644 --- a/src/ui/Forms/DownloadYouTubeDl.cs +++ b/src/ui/Forms/DownloadYouTubeDl.cs @@ -11,7 +11,7 @@ namespace Nikse.SubtitleEdit.Forms public sealed partial class DownloadYouTubeDl : Form { public const string Url = "https://github.com/ytdl-org/youtube-dl/releases/download/2021.06.06/youtube-dl.exe"; - public const string Sha512Hash = "78c009f4cf8ae56db150800d55faaac97c127c76c89715b23fe406d85c3c0628"; + public const string Sha512Hash = "8f0fd27419ef340d64bff928567b0e4b03d47ca19094b409605ad71ec2b5293a79f814dd2cd4591719a7e386b4041973353fbe90124dbfd4d004b19ea31457ed"; public bool AutoClose { get; internal set; } public DownloadYouTubeDl() @@ -85,10 +85,10 @@ namespace Nikse.SubtitleEdit.Forms Directory.CreateDirectory(folder); } - var hash = GetSha256Hash(e.Result); + var hash = GetSha512Hash(e.Result); if (hash != Sha512Hash) { - MessageBox.Show("youtube-dl SHA2-512 hash does not match!"); + MessageBox.Show("youtube-dl SHA-512 hash does not match!"); return; } @@ -107,14 +107,14 @@ namespace Nikse.SubtitleEdit.Forms labelPleaseWait.Text = string.Format(LanguageSettings.Current.SettingsFfmpeg.XDownloadOk, "youtube-dl"); } - private static string GetSha256Hash(byte[] buffer) + private static string GetSha512Hash(byte[] buffer) { using (var ms = new MemoryStream(buffer)) using (var bs = new BufferedStream(ms)) { - using (var sha256 = new SHA256Managed()) + using (var sha512 = new SHA512Managed()) { - byte[] hash = sha256.ComputeHash(bs); + byte[] hash = sha512.ComputeHash(bs); string hashString = string.Empty; foreach (byte x in hash) { diff --git a/src/ui/Logic/Language.cs b/src/ui/Logic/Language.cs index 9a18edda8..edb7a14d4 100644 --- a/src/ui/Logic/Language.cs +++ b/src/ui/Logic/Language.cs @@ -1899,7 +1899,7 @@ namespace Nikse.SubtitleEdit.Logic ApplyCustomOverrideTag = "Apply custom override tags...", SetPosition = "Set position...", GenerateProgressBar = "Generate progress bar...", - AssaResolutionChanger = "Change script resolution...", + AssaResolutionChanger = "Change ASSA script resolution...", FixCommonErrorsInSelectedLines = "Fix common errors in selected lines...", ChangeCasingForSelectedLines = "Change casing for selected lines...", SaveSelectedLines = "Save selected lines as...",