Skip to content

Commit

Permalink
2.2.0 Released.
Browse files Browse the repository at this point in the history
fix #12
Downgrade to .Net 4.5
  • Loading branch information
ludoux committed Mar 10, 2020
1 parent 53b5ce4 commit 7be6e84
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 100 deletions.
2 changes: 1 addition & 1 deletion LrcHelper/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
</configuration>
189 changes: 103 additions & 86 deletions LrcHelper/LrcDownloader.Designer.cs

Large diffs are not rendered by default.

16 changes: 9 additions & 7 deletions LrcHelper/LrcDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public LrcDownloader()
private void GETbutton_Click(object sender, EventArgs e)
{
string filenamePattern = FilenamePatterncomboBox.Text;
string enc = EncodingcomboBox.Text;
GETbutton.Enabled = false;
StatusInfolabel.Text = "状态信息";
StatusPDFinishedCountlabel.Text = "0";
Expand All @@ -38,7 +39,9 @@ private void GETbutton_Click(object sender, EventArgs e)
string Log = "";
LyricsStatus status = LyricsStatus.UNSURED;
if (ReviseRawcheckBox.Checked == false)
Log = DownloadLrc(".\\", filenamePattern, m, modelIndex, delayMsec, out status, out string filePath);//正常的自动化操作
{
Log = DownloadLrc(".\\", filenamePattern, m, modelIndex, delayMsec, out status, out string filePath, fileEncoding: enc);//正常的自动化操作
}
else
{
HttpRequest hr = new HttpRequest();
Expand All @@ -51,8 +54,7 @@ private void GETbutton_Click(object sender, EventArgs e)
Clipboard.SetText(sContentTransLyrics, TextDataFormat.UnicodeText);
if (MessageBox.Show("TransLyrics raw text has been set is in the clipboard. Please follow these guide below." + Environment.NewLine + Environment.NewLine + "==========" + Environment.NewLine + @"1. Use Notepad++ to read(such as ""paste"") text from the clipboard." + Environment.NewLine + @"2. Try to revise the text. The most mistake we face is wrong typo. (You can search "".lrc guidance"" to learn more.)" + Environment.NewLine + @"3. After revising, please set revised text to the clipboard(such as ""copy"")" + Environment.NewLine + @"4. Click ""Yes"" button. Software will use the revised text instead of the raw text." + Environment.NewLine + "==========" + Environment.NewLine + Environment.NewLine + @"**If you don't know why you're seeing this messagebox now or you don't know what to do, just click ""No"" button. Don't worry, nothing wrong will happen.**" + Environment.NewLine + @"You can click the blue label ""Need Help?"" in the LrcDownloader Form to learn more about this function.", "TransLyrics raw text - ReviseRaw(Func)_Step 2", MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
sContentTransLyrics = Clipboard.GetText(TextDataFormat.UnicodeText);

Log = DownloadLrc(".\\", filenamePattern, m, modelIndex, delayMsec, out status, out string filePath,revisedsContentOriLyricsForUserReviseFunc: sContentOriLyrics, revisedsContentTransLyricsForUserReviseFunc: sContentTransLyrics);
Log = DownloadLrc(".\\", filenamePattern, m, modelIndex, delayMsec, out status, out string filePath,revisedsContentOriLyricsForUserReviseFunc: sContentOriLyrics, revisedsContentTransLyricsForUserReviseFunc: sContentTransLyrics, fileEncoding: enc);
}
sw.Stop();
if (Log == "")
Expand Down Expand Up @@ -94,7 +96,7 @@ private void GETbutton_Click(object sender, EventArgs e)
Music m = new Music(idList[i], i + 1);
try
{
ErrorLog = DownloadLrc(@".\\" + FormatFileName.CleanInvalidFileName(pl.Name) + @"\", filenamePattern, m, modelIndex, delayMsec, out status,out filePath);
ErrorLog = DownloadLrc(@".\\" + FormatFileName.CleanInvalidFileName(pl.Name) + @"\", filenamePattern, m, modelIndex, delayMsec, out status,out filePath, fileEncoding: enc);
}
catch(Exception ex)
{
Expand Down Expand Up @@ -172,7 +174,7 @@ private void GETbutton_Click(object sender, EventArgs e)
string filePath = "";
try
{
ErrorLog = DownloadLrc(@".\\" + FormatFileName.CleanInvalidFileName(a.Name) + @"\", filenamePattern, m, modelIndex, delayMsec, out status, out filePath);
ErrorLog = DownloadLrc(@".\\" + FormatFileName.CleanInvalidFileName(a.Name) + @"\", filenamePattern, m, modelIndex, delayMsec, out status, out filePath, fileEncoding: enc);
}
catch (Exception ex)
{
Expand Down Expand Up @@ -286,7 +288,7 @@ private void Savelabel_Click(object sender, EventArgs e)
{
try
{
File.WriteAllText(".\\AdvancedSettings.txt", string.Format("Version:{0}\r\nTime:{1}\r\nLyricsStyle:{2}\r\nDelayMsec:{3}\r\nFilenamePattern:{4}\r\n***DO NOT CHANGE ANY TEXT AND/OR ENCODING***\r\n***If you don't want to use these settings ever, just delete this file.***", FileVersionInfo.GetVersionInfo(Application.ExecutablePath).FileVersion, DateTime.Now.ToString(), LyricsStylenumericUpDown.Value.ToString(), DelayMsecnumericUpDown.Value.ToString(), FilenamePatterncomboBox.Text), Encoding.UTF8);
File.WriteAllText(".\\AdvancedSettings.txt", string.Format("Version:{0}\r\nTime:{1}\r\nLyricsStyle:{2}\r\nDelayMsec:{3}\r\nFilenamePattern:{4}\r\nEncoding:{5}\r\n***DO NOT CHANGE ANY TEXT AND/OR ENCODING***\r\n***If you don't want to use these settings ever, just delete this file.***", FileVersionInfo.GetVersionInfo(Application.ExecutablePath).FileVersion, DateTime.Now.ToString(), LyricsStylenumericUpDown.Value.ToString(), DelayMsecnumericUpDown.Value.ToString(), FilenamePatterncomboBox.Text, EncodingcomboBox.Text), Encoding.UTF8);
}
catch (Exception)
{
Expand All @@ -305,7 +307,7 @@ private void LrcDownloader_Load(object sender, EventArgs e)
LyricsStylenumericUpDown.Value = Convert.ToDecimal(Regex.Match(settings, @"(?<=LyricsStyle:)\d+?(?=\r\n)", RegexOptions.IgnoreCase).Value.ToString());
DelayMsecnumericUpDown.Value = Convert.ToDecimal(Regex.Match(settings, @"(?<=DelayMsec:)(-)*\d+?(?=\r\n)", RegexOptions.IgnoreCase).Value.ToString()); //05-13 修正数值为负数的时候无匹配(变成""),不能进行Convert.ToDecimal("")。
FilenamePatterncomboBox.Text = Regex.Match(settings, @"(?<=FilenamePattern:).+?(?=\r\n)", RegexOptions.IgnoreCase).Value.ToString();

EncodingcomboBox.Text = Regex.Match(settings, @"(?<=Encoding:).+?(?=\r\n)", RegexOptions.IgnoreCase).Value.ToString();
}
}

Expand Down
6 changes: 3 additions & 3 deletions LrcHelper/LrcHelper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>LrcHelper</RootNamespace>
<AssemblyName>163lrc</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<IsWebBootstrapper>false</IsWebBootstrapper>
Expand Down Expand Up @@ -70,7 +70,8 @@
<ManifestKeyFile>LrcHelper_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>163lrc512.ico</ApplicationIcon>
<ApplicationIcon>
</ApplicationIcon>
</PropertyGroup>
<PropertyGroup />
<PropertyGroup>
Expand Down Expand Up @@ -152,7 +153,6 @@
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Content Include="163lrc512.ico" />
<Content Include="Lyrics.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
4 changes: 2 additions & 2 deletions LrcHelper/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("163lrc")]
[assembly: AssemblyCopyright("Copyright © 2019 ludoux")]
[assembly: AssemblyCopyright("Copyright © 2020 ludoux")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -34,6 +34,6 @@
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("2.1.1.0")]
[assembly: AssemblyFileVersion("2.2.0.0")]
[assembly: NeutralResourcesLanguage("en-001")]

2 changes: 1 addition & 1 deletion LrcHelper/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7be6e84

Please sign in to comment.