From b8f1b7f5f5da645cb7cd2b1a1c688fe4a6f6503d Mon Sep 17 00:00:00 2001 From: jitwxs Date: Fri, 16 Sep 2022 20:43:01 +0800 Subject: [PATCH 1/6] fix font fuzzy in different windows dpi #121 --- MusicLyricApp/MusicLyricApp.csproj | 4 ++++ MusicLyricApp/Properties/app.manifest | 11 +++++++++++ 2 files changed, 15 insertions(+) create mode 100644 MusicLyricApp/Properties/app.manifest diff --git a/MusicLyricApp/MusicLyricApp.csproj b/MusicLyricApp/MusicLyricApp.csproj index dba7c00..9865499 100644 --- a/MusicLyricApp/MusicLyricApp.csproj +++ b/MusicLyricApp/MusicLyricApp.csproj @@ -70,6 +70,9 @@ Favicon2.ico + + Properties\app.manifest + ..\packages\Costura.Fody.5.8.0-alpha0098\lib\netstandard1.0\Costura.dll @@ -337,6 +340,7 @@ + diff --git a/MusicLyricApp/Properties/app.manifest b/MusicLyricApp/Properties/app.manifest new file mode 100644 index 0000000..8fc7f02 --- /dev/null +++ b/MusicLyricApp/Properties/app.manifest @@ -0,0 +1,11 @@ + + + + + + + true + PerMonitorV2 + + + \ No newline at end of file From 77594b06ec3c8a524923ec883cf0532631be05ae Mon Sep 17 00:00:00 2001 From: jitwxs Date: Fri, 16 Sep 2022 20:56:29 +0800 Subject: [PATCH 2/6] upgrade version to v4.10 --- MusicLyricApp/Bean/Constants.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MusicLyricApp/Bean/Constants.cs b/MusicLyricApp/Bean/Constants.cs index f9ce159..595a3d7 100644 --- a/MusicLyricApp/Bean/Constants.cs +++ b/MusicLyricApp/Bean/Constants.cs @@ -4,7 +4,7 @@ namespace MusicLyricApp.Bean { public static class Constants { - public const string Version = "v4.9"; + public const string Version = "v4.10"; public static readonly string SettingPath = Environment.CurrentDirectory + "\\MusicLyricAppSetting.json"; From 42c7f70c5c28315a80ccfcae81dd7aae549e790f Mon Sep 17 00:00:00 2001 From: jitwxs Date: Fri, 16 Sep 2022 20:59:25 +0800 Subject: [PATCH 3/6] upgrade version to v5.0 --- MusicLyricApp/Bean/Constants.cs | 2 +- MusicLyricApp/MainForm.Designer.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MusicLyricApp/Bean/Constants.cs b/MusicLyricApp/Bean/Constants.cs index 595a3d7..4841867 100644 --- a/MusicLyricApp/Bean/Constants.cs +++ b/MusicLyricApp/Bean/Constants.cs @@ -4,7 +4,7 @@ namespace MusicLyricApp.Bean { public static class Constants { - public const string Version = "v4.10"; + public const string Version = "v5.0"; public static readonly string SettingPath = Environment.CurrentDirectory + "\\MusicLyricAppSetting.json"; diff --git a/MusicLyricApp/MainForm.Designer.cs b/MusicLyricApp/MainForm.Designer.cs index 5a98658..c60e925 100644 --- a/MusicLyricApp/MainForm.Designer.cs +++ b/MusicLyricApp/MainForm.Designer.cs @@ -368,7 +368,7 @@ private void InitializeComponent() this.MainMenuStrip = this.Top_MenuStrip; this.MaximizeBox = false; this.Name = "MainForm"; - this.Text = "云音乐歌词提取 v4.9"; + this.Text = "云音乐歌词提取 " + Constants.Version; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing); this.MouseEnter += new System.EventHandler(this.MainForm_MouseEnter); this.Top_MenuStrip.ResumeLayout(false); From 867f0d71fe322a3f0ef0e484ba9945a97417c91a Mon Sep 17 00:00:00 2001 From: jitwxs Date: Fri, 16 Sep 2022 21:00:03 +0800 Subject: [PATCH 4/6] adjust qq music pic url quality #123 --- MusicLyricApp/Api/QQMusicApiV2.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MusicLyricApp/Api/QQMusicApiV2.cs b/MusicLyricApp/Api/QQMusicApiV2.cs index 7c12f03..58ea772 100644 --- a/MusicLyricApp/Api/QQMusicApiV2.cs +++ b/MusicLyricApp/Api/QQMusicApiV2.cs @@ -100,7 +100,7 @@ private static string ContractSinger(QQMusicBean.Singer[] singers) private static string BuildPicUrl(QQMusicBean.Album album) { - return "https://y.qq.com/music/photo_new/T002R300x300M000" + album.Pmid + ".jpg"; + return "https://y.qq.com/music/photo_new/T002R800x800M000" + album.Pmid + ".jpg"; } } } \ No newline at end of file From 2f592e7b80ebe7ec46223e945bb3e2cb3c2c0e2f Mon Sep 17 00:00:00 2001 From: jitwxs Date: Fri, 16 Sep 2022 21:17:23 +0800 Subject: [PATCH 5/6] fix translated lyrics are not added properly when stopping ignoring empty lyrics #122 --- MusicLyricApp/Utils/LyricUtils.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/MusicLyricApp/Utils/LyricUtils.cs b/MusicLyricApp/Utils/LyricUtils.cs index 6f10446..0f94c64 100644 --- a/MusicLyricApp/Utils/LyricUtils.cs +++ b/MusicLyricApp/Utils/LyricUtils.cs @@ -46,9 +46,8 @@ private static async Task> FormatLyric(string originLrc, strin { var showLrcType = searchInfo.SettingBean.Param.ShowLrcType; var searchSource = searchInfo.SettingBean.Param.SearchSource; - var ignoreEmptyLine = searchInfo.SettingBean.Param.IgnoreEmptyLyric; - var originLyrics = SplitLrc(originLrc, searchSource, ignoreEmptyLine); + var originLyrics = SplitLrc(originLrc, searchSource, searchInfo.SettingBean.Param.IgnoreEmptyLyric); /* * 1、原文歌词不存在 @@ -64,7 +63,7 @@ private static async Task> FormatLyric(string originLrc, strin // 译文处理,启用罗马音进行转换,否则使用原始的译文 var romajiConfig = searchInfo.SettingBean.Config.RomajiConfig; - var translateLyrics = SplitLrc(translateLrc, searchSource, ignoreEmptyLine); + var translateLyrics = SplitLrc(translateLrc, searchSource, true); translateLyrics = DealTranslateLyric(originLyrics, translateLyrics, searchInfo.SettingBean); From 934f516fc533c571d4e84f903c6d757656c5376e Mon Sep 17 00:00:00 2001 From: jitwxs Date: Fri, 16 Sep 2022 21:28:03 +0800 Subject: [PATCH 6/6] optimized saveFileDialog logic --- MusicLyricApp/MainForm.cs | 81 +++++++++++++++++++++------------------ 1 file changed, 43 insertions(+), 38 deletions(-) diff --git a/MusicLyricApp/MainForm.cs b/MusicLyricApp/MainForm.cs index 2df1a2d..930ea7d 100644 --- a/MusicLyricApp/MainForm.cs +++ b/MusicLyricApp/MainForm.cs @@ -517,21 +517,23 @@ private async void SingleSave(string songId) } var saveDialog = new SaveFileDialog(); + saveDialog.FileName = GlobalUtils.GetOutputName(saveVo.SongVo, _globalSearchInfo.SettingBean.Param.OutputFileNameType); + saveDialog.Filter = _globalSearchInfo.SettingBean.Param.OutputFileFormat.ToDescription(); + + if (saveDialog.ShowDialog() != DialogResult.OK) + { + return; + } + try { - saveDialog.FileName = GlobalUtils.GetOutputName(saveVo.SongVo, _globalSearchInfo.SettingBean.Param.OutputFileNameType); - saveDialog.Filter = _globalSearchInfo.SettingBean.Param.OutputFileFormat.ToDescription(); - if (saveDialog.ShowDialog() == DialogResult.OK) + using (var sw = new StreamWriter(saveDialog.FileName, false, GlobalUtils.GetEncoding(_globalSearchInfo.SettingBean.Param.Encoding))) { - using (var sw = new StreamWriter(saveDialog.FileName, false, - GlobalUtils.GetEncoding(_globalSearchInfo.SettingBean.Param.Encoding))) - { - await sw.WriteAsync(await LyricUtils.GetOutputContent(saveVo.LyricVo, _globalSearchInfo)); - await sw.FlushAsync(); - } - - MessageBox.Show(string.Format(ErrorMsg.SAVE_COMPLETE, 1, 0), "提示"); + await sw.WriteAsync(await LyricUtils.GetOutputContent(saveVo.LyricVo, _globalSearchInfo)); + await sw.FlushAsync(); } + + MessageBox.Show(string.Format(ErrorMsg.SAVE_COMPLETE, 1, 0), "提示"); } catch (System.Exception ew) { @@ -546,49 +548,52 @@ private async void SingleSave(string songId) private async void BatchSave() { var saveDialog = new SaveFileDialog(); + saveDialog.FileName = "直接选择保存路径即可,无需修改此处内容"; + saveDialog.Filter = _globalSearchInfo.SettingBean.Param.OutputFileFormat.ToDescription(); + + if (saveDialog.ShowDialog() != DialogResult.OK) + { + return; + } + + // 保存 var skipCount = 0; var success = new HashSet(); try { - saveDialog.FileName = "直接选择保存路径即可,无需修改此处内容"; - saveDialog.Filter = _globalSearchInfo.SettingBean.Param.OutputFileFormat.ToDescription(); - if (saveDialog.ShowDialog() == DialogResult.OK) - { - var localFilePath = saveDialog.FileName; - // 获取文件后缀 - var fileSuffix = localFilePath.Substring(localFilePath.LastIndexOf(".")); - //获取文件路径,不带文件名 - var filePath = localFilePath.Substring(0, localFilePath.LastIndexOf("\\")); - + var localFilePath = saveDialog.FileName; + // 获取文件后缀 + var fileSuffix = localFilePath.Substring(localFilePath.LastIndexOf(".")); + //获取文件路径,不带文件名 + var filePath = localFilePath.Substring(0, localFilePath.LastIndexOf("\\")); - foreach (var item in _globalSaveVoMap) + foreach (var item in _globalSaveVoMap) + { + var saveVo = item.Value; + var lyricVo = saveVo.LyricVo; + if (lyricVo.IsEmpty()) { - var saveVo = item.Value; - var lyricVo = saveVo.LyricVo; - if (lyricVo.IsEmpty()) - { - skipCount++; - continue; - } + skipCount++; + continue; + } - var path = filePath + '/' + GlobalUtils.GetOutputName(saveVo.SongVo, _globalSearchInfo.SettingBean.Param.OutputFileNameType) + fileSuffix; - using(var sw = new StreamWriter(path, false, GlobalUtils.GetEncoding(_globalSearchInfo.SettingBean.Param.Encoding))) - { - await sw.WriteAsync(await LyricUtils.GetOutputContent(lyricVo, _globalSearchInfo)); - await sw.FlushAsync(); - success.Add(item.Key); - } + var path = filePath + '/' + GlobalUtils.GetOutputName(saveVo.SongVo, _globalSearchInfo.SettingBean.Param.OutputFileNameType) + fileSuffix; + using(var sw = new StreamWriter(path, false, GlobalUtils.GetEncoding(_globalSearchInfo.SettingBean.Param.Encoding))) + { + await sw.WriteAsync(await LyricUtils.GetOutputContent(lyricVo, _globalSearchInfo)); + await sw.FlushAsync(); + success.Add(item.Key); } } + + MessageBox.Show(string.Format(ErrorMsg.SAVE_COMPLETE, success.Count, skipCount), "提示"); } catch (System.Exception ew) { _logger.Error(ew, "批量保存失败"); MessageBox.Show("批量保存失败,错误信息:\n" + ew.Message); } - - MessageBox.Show(string.Format(ErrorMsg.SAVE_COMPLETE, success.Count, skipCount), "提示"); // 输出日志 var log = new StringBuilder();