From ab03870b6a97f30541c94c297e17be0c3e09594d Mon Sep 17 00:00:00 2001 From: Zhe Fang Date: Thu, 26 Jun 2025 14:43:06 -0400 Subject: [PATCH] add: support qq music, kugou music, netease music as lyrics providers --- .../BetterLyrics.WinUI3/App.xaml | 1 + .../BetterLyrics.WinUI3/App.xaml.cs | 8 +- .../BetterLyrics.WinUI3.csproj | 1 + .../Converter/ColorToBrushConverter.cs | 4 +- .../CornerRadiusToDoubleConverter.cs | 27 ++ .../Converter/EnumToIntConverter.cs | 4 +- .../Converter/IntToCornerRadius.cs | 4 +- ...icsSearchProviderToDisplayNameConverter.cs | 19 +- ...chedLocalFilesPathToVisibilityConverter.cs | 4 +- .../BetterLyrics.WinUI3/Enums/LyricsFormat.cs | 9 +- .../Enums/LyricsSearchProvider.cs | 58 +++- .../Helper/AnimationHelper.cs | 13 + .../BetterLyrics.WinUI3/Helper/AppInfo.cs | 7 + .../Helper/LyricsParser.cs | 77 +++++ .../Services/MusicSearchService.cs | 288 ++++++++++++------ .../Strings/en-US/Resources.resw | 22 +- .../Strings/ja-JP/Resources.resw | 24 +- .../Strings/ko-KR/Resources.resw | 24 +- .../Strings/zh-CN/Resources.resw | 22 +- .../Strings/zh-TW/Resources.resw | 24 +- .../ViewModels/LyricsPageViewModel.cs | 2 +- .../LyricsRendererViewModel.Layout.cs | 20 +- .../LyricsRendererViewModel.Messages.cs | 9 +- .../LyricsRendererViewModel.Renderer.cs | 26 +- .../ViewModels/LyricsRendererViewModel.cs | 16 +- .../ViewModels/SettingsViewModel.cs | 22 +- .../BetterLyrics.WinUI3/Views/LyricsPage.xaml | 84 ++--- .../Views/LyricsPage.xaml.cs | 4 +- .../Views/SettingsPage.xaml | 7 +- 29 files changed, 624 insertions(+), 206 deletions(-) create mode 100644 BetterLyrics.WinUI3/BetterLyrics.WinUI3/Converter/CornerRadiusToDoubleConverter.cs diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/App.xaml b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/App.xaml index 87900e9..c007ff2 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/App.xaml +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/App.xaml @@ -45,6 +45,7 @@ + diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/App.xaml.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/App.xaml.cs index ede3ab6..2d4dc2c 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/App.xaml.cs +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/App.xaml.cs @@ -1,5 +1,8 @@ // 2025/6/23 by Zhe Fang +using System; +using System.Text; +using System.Threading.Tasks; using BetterInAppLyrics.WinUI3.ViewModels; using BetterLyrics.WinUI3.Helper; using BetterLyrics.WinUI3.Services; @@ -12,9 +15,6 @@ using Microsoft.UI.Dispatching; using Microsoft.UI.Xaml; using Microsoft.Windows.ApplicationModel.Resources; using Serilog; -using System; -using System.Text; -using System.Threading.Tasks; // To learn more about WinUI, the WinUI project structure, // and more about our project templates, see: http://aka.ms/winui-project-info. @@ -183,7 +183,7 @@ namespace BetterLyrics.WinUI3 UnobservedTaskExceptionEventArgs e ) { - _logger.LogError(e.Exception, "TaskScheduler_UnobservedTaskException"); + //_logger.LogError(e.Exception, "TaskScheduler_UnobservedTaskException"); } #endregion diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/BetterLyrics.WinUI3.csproj b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/BetterLyrics.WinUI3.csproj index 20b4937..8658139 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/BetterLyrics.WinUI3.csproj +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/BetterLyrics.WinUI3.csproj @@ -36,6 +36,7 @@ + diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Converter/ColorToBrushConverter.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Converter/ColorToBrushConverter.cs index 5e4b0c3..995a639 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Converter/ColorToBrushConverter.cs +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Converter/ColorToBrushConverter.cs @@ -1,8 +1,8 @@ // 2025/6/23 by Zhe Fang +using System; using Microsoft.UI.Xaml.Data; using Microsoft.UI.Xaml.Media; -using System; using Windows.UI; namespace BetterLyrics.WinUI3.Converter @@ -10,7 +10,7 @@ namespace BetterLyrics.WinUI3.Converter /// /// Defines the /// - public class ColorToBrushConverter : IValueConverter + public partial class ColorToBrushConverter : IValueConverter { #region Methods diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Converter/CornerRadiusToDoubleConverter.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Converter/CornerRadiusToDoubleConverter.cs new file mode 100644 index 0000000..2af9917 --- /dev/null +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Converter/CornerRadiusToDoubleConverter.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.UI.Xaml.Data; + +namespace BetterLyrics.WinUI3.Converter +{ + internal partial class CornerRadiusToDoubleConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, string language) + { + if (value is Microsoft.UI.Xaml.CornerRadius cornerRadius) + { + // Convert CornerRadius to an integer value, e.g., using the top-left radius + return (double)cornerRadius.TopLeft; + } + return .0; // or handle the case where value is not a CornerRadius + } + + public object ConvertBack(object value, Type targetType, object parameter, string language) + { + throw new NotImplementedException(); + } + } +} diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Converter/EnumToIntConverter.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Converter/EnumToIntConverter.cs index 2f3a7f1..adec4f4 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Converter/EnumToIntConverter.cs +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Converter/EnumToIntConverter.cs @@ -1,14 +1,14 @@ // 2025/6/23 by Zhe Fang -using Microsoft.UI.Xaml.Data; using System; +using Microsoft.UI.Xaml.Data; namespace BetterLyrics.WinUI3.Converter { /// /// Defines the /// - internal class EnumToIntConverter : IValueConverter + internal partial class EnumToIntConverter : IValueConverter { #region Methods diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Converter/IntToCornerRadius.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Converter/IntToCornerRadius.cs index e34cf52..e0d48e3 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Converter/IntToCornerRadius.cs +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Converter/IntToCornerRadius.cs @@ -1,14 +1,14 @@ // 2025/6/23 by Zhe Fang -using Microsoft.UI.Xaml.Data; using System; +using Microsoft.UI.Xaml.Data; namespace BetterLyrics.WinUI3.Converter { /// /// Defines the /// - public class IntToCornerRadius : IValueConverter + public partial class IntToCornerRadius : IValueConverter { #region Methods diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Converter/LyricsSearchProviderToDisplayNameConverter.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Converter/LyricsSearchProviderToDisplayNameConverter.cs index 855cd06..88b8abd 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Converter/LyricsSearchProviderToDisplayNameConverter.cs +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Converter/LyricsSearchProviderToDisplayNameConverter.cs @@ -9,7 +9,7 @@ namespace BetterLyrics.WinUI3.Converter /// /// Defines the /// - public class LyricsSearchProviderToDisplayNameConverter : IValueConverter + public partial class LyricsSearchProviderToDisplayNameConverter : IValueConverter { #region Methods @@ -30,9 +30,18 @@ namespace BetterLyrics.WinUI3.Converter LyricsSearchProvider.LrcLib => App.ResourceLoader!.GetString( "LyricsSearchProviderLrcLib" ), - //LyricsSearchProvider.AmllTtmlDb => App.ResourceLoader!.GetString( - // "LyricsSearchProviderAmllTtmlDb" - //), + LyricsSearchProvider.QQ => App.ResourceLoader!.GetString( + "LyricsSearchProviderQQ" + ), + LyricsSearchProvider.Netease => App.ResourceLoader!.GetString( + "LyricsSearchProviderNetease" + ), + LyricsSearchProvider.Kugou => App.ResourceLoader!.GetString( + "LyricsSearchProviderKugou" + ), + LyricsSearchProvider.AmllTtmlDb => App.ResourceLoader!.GetString( + "LyricsSearchProviderAmllTtmlDb" + ), LyricsSearchProvider.LocalLrcFile => App.ResourceLoader!.GetString( "LyricsSearchProviderLocalLrcFile" ), @@ -45,7 +54,7 @@ namespace BetterLyrics.WinUI3.Converter LyricsSearchProvider.LocalTtmlFile => App.ResourceLoader!.GetString( "LyricsSearchProviderTtmlFile" ), - _ => throw new ArgumentOutOfRangeException(nameof(provider), provider, null), + _ => "", }; } return ""; diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Converter/MatchedLocalFilesPathToVisibilityConverter.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Converter/MatchedLocalFilesPathToVisibilityConverter.cs index 027e3ef..b52af99 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Converter/MatchedLocalFilesPathToVisibilityConverter.cs +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Converter/MatchedLocalFilesPathToVisibilityConverter.cs @@ -1,15 +1,15 @@ // 2025/6/23 by Zhe Fang +using System; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Data; -using System; namespace BetterLyrics.WinUI3.Converter { /// /// Defines the /// - public class MatchedLocalFilesPathToVisibilityConverter : IValueConverter + public partial class MatchedLocalFilesPathToVisibilityConverter : IValueConverter { #region Methods diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Enums/LyricsFormat.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Enums/LyricsFormat.cs index ab48441..4ab07ee 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Enums/LyricsFormat.cs +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Enums/LyricsFormat.cs @@ -29,6 +29,9 @@ namespace BetterLyrics.WinUI3.Enums /// Defines the Ttml /// Ttml, + Qrc, + Krc, + NotSpecified, } #endregion @@ -45,7 +48,7 @@ namespace BetterLyrics.WinUI3.Enums /// /// The content /// The - public static LyricsFormat? Detect(string content) + public static LyricsFormat? DetectFormat(this string content) { if ( content.StartsWith(" ".lrc", + LyricsFormat.Qrc => ".qrc", + LyricsFormat.Krc => ".krc", LyricsFormat.Eslrc => ".eslrc", LyricsFormat.Ttml => ".ttml", - _ => throw new ArgumentOutOfRangeException(nameof(format), format, null), + _ => ".*", }; } diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Enums/LyricsSearchProvider.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Enums/LyricsSearchProvider.cs index f16db2e..1d8c2f1 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Enums/LyricsSearchProvider.cs +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Enums/LyricsSearchProvider.cs @@ -1,5 +1,7 @@ // 2025/6/23 by Zhe Fang +using BetterLyrics.WinUI3.Helper; + namespace BetterLyrics.WinUI3.Enums { #region Enums @@ -13,8 +15,11 @@ namespace BetterLyrics.WinUI3.Enums /// Defines the LrcLib /// LrcLib, + QQ, + Netease, + Kugou, - //AmllTtmlDb, + AmllTtmlDb, /// /// Defines the LocalMusicFile @@ -37,5 +42,56 @@ namespace BetterLyrics.WinUI3.Enums LocalTtmlFile, } + public static class LyricsSearchProviderExtensions + { + /// + /// The IsLocal + /// + /// The provider + /// The + public static bool IsLocal(this LyricsSearchProvider provider) + { + return provider + is LyricsSearchProvider.LocalMusicFile + or LyricsSearchProvider.LocalLrcFile + or LyricsSearchProvider.LocalEslrcFile + or LyricsSearchProvider.LocalTtmlFile; + } + + public static bool IsRemote(this LyricsSearchProvider provider) + { + return !provider.IsLocal(); + } + + public static string GetCacheDirectory(this LyricsSearchProvider provider) + { + return provider switch + { + LyricsSearchProvider.LrcLib => AppInfo.LrcLibLyricsCacheDirectory, + LyricsSearchProvider.QQ => AppInfo.QQLyricsCacheDirectory, + LyricsSearchProvider.Netease => AppInfo.NeteaseLyricsCacheDirectory, + LyricsSearchProvider.Kugou => AppInfo.KugouLyricsCacheDirectory, + LyricsSearchProvider.AmllTtmlDb => AppInfo.AmllTtmlDbLyricsCacheDirectory, + _ => throw new System.ArgumentOutOfRangeException(nameof(provider)), + }; + } + + public static LyricsFormat GetLyricsFormat(this LyricsSearchProvider provider) + { + return provider switch + { + LyricsSearchProvider.LrcLib => LyricsFormat.Lrc, + LyricsSearchProvider.QQ => LyricsFormat.Qrc, + LyricsSearchProvider.Kugou => LyricsFormat.Krc, + LyricsSearchProvider.Netease => LyricsFormat.Lrc, + LyricsSearchProvider.AmllTtmlDb => LyricsFormat.Ttml, + LyricsSearchProvider.LocalLrcFile => LyricsFormat.Lrc, + LyricsSearchProvider.LocalEslrcFile => LyricsFormat.Eslrc, + LyricsSearchProvider.LocalTtmlFile => LyricsFormat.Ttml, + _ => LyricsFormat.NotSpecified, + }; + } + } + #endregion } diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Helper/AnimationHelper.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Helper/AnimationHelper.cs index 2301d24..bb2b610 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Helper/AnimationHelper.cs +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Helper/AnimationHelper.cs @@ -199,6 +199,19 @@ namespace BetterLyrics.WinUI3.Helper } } + /// + /// 立即跳转到指定值,无动画 + /// + /// 目标值 + public void JumpTo(T value) + { + _currentValue = value; + _startValue = value; + _targetValue = value; + _progress = 1f; + _isTransitioning = false; + } + /// /// The Update /// diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Helper/AppInfo.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Helper/AppInfo.cs index ae4dc6b..aadd864 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Helper/AppInfo.cs +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Helper/AppInfo.cs @@ -83,6 +83,10 @@ namespace BetterLyrics.WinUI3.Helper public static string AmllTtmlDbLyricsCacheDirectory => Path.Combine(CacheFolder, "amll-ttml-db-lyrics"); + public static string QQLyricsCacheDirectory => Path.Combine(CacheFolder, "qq-lyrics"); + public static string KugouLyricsCacheDirectory => Path.Combine(CacheFolder, "kugou-lyrics"); + public static string NeteaseLyricsCacheDirectory => + Path.Combine(CacheFolder, "netease-lyrics"); public static string AmllTtmlDbIndexPath => Path.Combine(CacheFolder, "amll-ttml-db-index.json"); @@ -116,6 +120,9 @@ namespace BetterLyrics.WinUI3.Helper Directory.CreateDirectory(LocalFolder); Directory.CreateDirectory(LogDirectory); Directory.CreateDirectory(LrcLibLyricsCacheDirectory); + Directory.CreateDirectory(QQLyricsCacheDirectory); + Directory.CreateDirectory(KugouLyricsCacheDirectory); + Directory.CreateDirectory(NeteaseLyricsCacheDirectory); Directory.CreateDirectory(AmllTtmlDbLyricsCacheDirectory); } diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Helper/LyricsParser.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Helper/LyricsParser.cs index 6140c62..ddcf39b 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Helper/LyricsParser.cs +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Helper/LyricsParser.cs @@ -7,6 +7,8 @@ using System.Text.RegularExpressions; using System.Xml.Linq; using BetterLyrics.WinUI3.Enums; using BetterLyrics.WinUI3.Models; +using Lyricify.Lyrics.Models; +using Microsoft.UI.Xaml.Shapes; namespace BetterLyrics.WinUI3.Helper { @@ -50,6 +52,18 @@ namespace BetterLyrics.WinUI3.Helper case LyricsFormat.Eslrc: ParseLrc(raw, durationMs); break; + case LyricsFormat.Qrc: + ParseUsingLyricify( + Lyricify.Lyrics.Parsers.QrcParser.Parse(raw).Lines, + durationMs + ); + break; + case LyricsFormat.Krc: + ParseUsingLyricify( + Lyricify.Lyrics.Parsers.KrcParser.Parse(raw).Lines, + durationMs + ); + break; case LyricsFormat.Ttml: ParseTtml(raw, durationMs); break; @@ -204,6 +218,69 @@ namespace BetterLyrics.WinUI3.Helper } } + private void ParseUsingLyricify(List? lines, int durationMs) + { + List lyricsLines = []; + + if (lines != null && lines.Count > 0) + { + lyricsLines = []; + for (int lineIndex = 0; lineIndex < lines.Count; lineIndex++) + { + var lineRead = lines[lineIndex]; + var lineWrite = new LyricsLine + { + StartMs = lineRead.StartTime ?? 0, + Text = lineRead.Text, + CharTimings = [], + }; + + if (lineIndex + 1 < lines.Count) + { + lineWrite.EndMs = lines[lineIndex + 1].StartTime ?? 0; + } + else + { + lineWrite.EndMs = durationMs; + } + + var syllables = (lineRead as SyllableLineInfo)?.Syllables; + if (syllables != null) + { + int startIndex = 0; + for ( + int syllableIndex = 0; + syllableIndex < syllables.Count; + syllableIndex++ + ) + { + var syllable = syllables[syllableIndex]; + var charTiming = new CharTiming + { + StartMs = syllable.StartTime, + Text = syllable.Text, + StartIndex = startIndex, + }; + if (syllableIndex + 1 < syllables.Count) + { + charTiming.EndMs = syllables[syllableIndex + 1].StartTime; + } + else + { + charTiming.EndMs = lineWrite.EndMs; + } + lineWrite.CharTimings.Add(charTiming); + startIndex += syllable.Text.Length; + } + } + + lyricsLines.Add(lineWrite); + } + } + + _multiLangLyricsLines.Add(lyricsLines); + } + /// /// The ParseTtml /// diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Services/MusicSearchService.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Services/MusicSearchService.cs index b1e7d6f..8f1f96d 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Services/MusicSearchService.cs +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Services/MusicSearchService.cs @@ -118,117 +118,108 @@ namespace BetterLyrics.WinUI3.Services } string? cachedLyrics; + LyricsFormat lyricsFormat = provider.Provider.GetLyricsFormat(); - switch (provider.Provider) + // Check cache first + if (provider.Provider.IsRemote()) { - case LyricsSearchProvider.LrcLib: - // Check cache first - cachedLyrics = ReadCache( - title, - artist, - LyricsFormat.Lrc, - AppInfo.LrcLibLyricsCacheDirectory - ); - if (!string.IsNullOrWhiteSpace(cachedLyrics)) - { - return (cachedLyrics, LyricsFormat.Lrc); - } - break; - //case LyricsSearchProvider.AmllTtmlDb: - // // Check cache first - // cachedLyrics = ReadCache( - // title, - // artist, - // LyricsFormat.Ttml, - // AppInfo.AmllTtmlDbLyricsCacheDirectory - // ); - // if (!string.IsNullOrWhiteSpace(cachedLyrics)) - // { - // return (cachedLyrics, LyricsFormat.Ttml); - // } - // break; - default: - break; + cachedLyrics = ReadCache( + title, + artist, + lyricsFormat, + provider.Provider.GetCacheDirectory() + ); + if (!string.IsNullOrWhiteSpace(cachedLyrics)) + { + return (cachedLyrics, lyricsFormat); + } } string? searchedLyrics = null; - switch (provider.Provider) + if (provider.Provider.IsLocal()) { - case LyricsSearchProvider.LocalMusicFile: + if (provider.Provider == LyricsSearchProvider.LocalMusicFile) + { searchedLyrics = LocalLyricsSearchInMusicFiles(title, artist); - break; - case LyricsSearchProvider.LocalLrcFile: + } + else + { searchedLyrics = await LocalLyricsSearchInLyricsFiles( title, artist, - LyricsFormat.Lrc + lyricsFormat ); - break; - case LyricsSearchProvider.LocalEslrcFile: - searchedLyrics = await LocalLyricsSearchInLyricsFiles( - title, - artist, - LyricsFormat.Eslrc - ); - break; - case LyricsSearchProvider.LocalTtmlFile: - searchedLyrics = await LocalLyricsSearchInLyricsFiles( - title, - artist, - LyricsFormat.Ttml - ); - break; - case LyricsSearchProvider.LrcLib: - searchedLyrics = await SearchLrcLibAsync( - title, - artist, - album, - (int)(durationMs / 1000), - matchMode - ); - break; - //case LyricsSearchProvider.AmllTtmlDb: - // searchedLyrics = await SearchAmllTtmlDbAsync(title, artist); - // break; - default: - break; + } } - - if (!string.IsNullOrWhiteSpace(searchedLyrics)) + else { switch (provider.Provider) { case LyricsSearchProvider.LrcLib: - WriteCache( + searchedLyrics = await SearchLrcLibAsync( title, artist, - searchedLyrics, - LyricsFormat.Lrc, - AppInfo.LrcLibLyricsCacheDirectory + album, + (int)(durationMs / 1000), + matchMode ); - return (searchedLyrics, LyricsFormat.Lrc); - //case LyricsSearchProvider.AmllTtmlDb: - // WriteCache( - // title, - // artist, - // searchedLyrics, - // LyricsFormat.Ttml, - // AppInfo.AmllTtmlDbLyricsCacheDirectory - // ); - // return (searchedLyrics, LyricsFormat.Ttml); - case LyricsSearchProvider.LocalMusicFile: - return (searchedLyrics, LyricsFormatExtensions.Detect(searchedLyrics)); - case LyricsSearchProvider.LocalLrcFile: - return (searchedLyrics, LyricsFormat.Lrc); - case LyricsSearchProvider.LocalEslrcFile: - return (searchedLyrics, LyricsFormat.Eslrc); - case LyricsSearchProvider.LocalTtmlFile: - return (searchedLyrics, LyricsFormat.Ttml); + break; + case LyricsSearchProvider.QQ: + searchedLyrics = await SearchQQAsync( + title, + artist, + album, + (int)durationMs, + matchMode + ); + break; + case LyricsSearchProvider.Kugou: + searchedLyrics = await SearchKugouAsync( + title, + artist, + album, + (int)durationMs, + matchMode + ); + break; + case LyricsSearchProvider.Netease: + searchedLyrics = await SearchNeteaseAsync( + title, + artist, + album, + (int)durationMs, + matchMode + ); + break; + case LyricsSearchProvider.AmllTtmlDb: + searchedLyrics = await SearchAmllTtmlDbAsync(title, artist); + break; default: break; } } + + if (!string.IsNullOrWhiteSpace(searchedLyrics)) + { + if (provider.Provider.IsRemote()) + { + WriteCache( + title, + artist, + searchedLyrics, + lyricsFormat, + provider.Provider.GetCacheDirectory() + ); + } + + return ( + searchedLyrics, + lyricsFormat == LyricsFormat.NotSpecified + ? searchedLyrics.DetectFormat() + : lyricsFormat + ); + } } return (null, null); @@ -332,7 +323,10 @@ namespace BetterLyrics.WinUI3.Services return plain; } } - catch (Exception) { } + catch (Exception e) + { + throw e; + } } } } @@ -422,6 +416,124 @@ namespace BetterLyrics.WinUI3.Services return null; } + private async Task SearchQQAsync( + string title, + string artist, + string album, + int durationMs, + MusicSearchMatchMode matchMode + ) + { + string? queryId = ( + ( + await new Lyricify.Lyrics.Searchers.QQMusicSearcher().SearchForResult( + new Lyricify.Lyrics.Models.TrackMultiArtistMetadata() + { + DurationMs = + matchMode == MusicSearchMatchMode.TitleArtistAlbumAndDuration + ? durationMs + : null, + Album = + matchMode == MusicSearchMatchMode.TitleArtistAlbumAndDuration + ? album + : null, + AlbumArtists = [artist], + Artists = [artist], + Title = title, + } + ) + ) as Lyricify.Lyrics.Searchers.QQMusicSearchResult + )?.Id; + if (queryId is string id) + { + return (await Lyricify.Lyrics.Decrypter.Qrc.Helper.GetLyricsAsync(id))?.Lyrics; + } + return null; + } + + private async Task SearchKugouAsync( + string title, + string artist, + string album, + int durationMs, + MusicSearchMatchMode matchMode + ) + { + string? queryHash = ( + ( + await new Lyricify.Lyrics.Searchers.KugouSearcher().SearchForResult( + new Lyricify.Lyrics.Models.TrackMultiArtistMetadata() + { + DurationMs = + matchMode == MusicSearchMatchMode.TitleArtistAlbumAndDuration + ? durationMs + : null, + Album = + matchMode == MusicSearchMatchMode.TitleArtistAlbumAndDuration + ? album + : null, + AlbumArtists = [artist], + Artists = [artist], + Title = title, + } + ) + ) as Lyricify.Lyrics.Searchers.KugouSearchResult + )?.Hash; + if (queryHash != null) + { + var candidate = ( + await Lyricify.Lyrics.Helpers.ProviderHelper.KugouApi.GetSearchLyrics( + hash: queryHash + ) + )?.Candidates.FirstOrDefault(); + if (candidate != null) + { + return await Lyricify.Lyrics.Decrypter.Krc.Helper.GetLyricsAsync( + candidate.Id, + candidate.AccessKey + ); + } + } + return null; + } + + private async Task SearchNeteaseAsync( + string title, + string artist, + string album, + int durationMs, + MusicSearchMatchMode matchMode + ) + { + string? queryId = ( + ( + await new Lyricify.Lyrics.Searchers.NeteaseSearcher().SearchForResult( + new Lyricify.Lyrics.Models.TrackMultiArtistMetadata() + { + DurationMs = + matchMode == MusicSearchMatchMode.TitleArtistAlbumAndDuration + ? durationMs + : null, + Album = + matchMode == MusicSearchMatchMode.TitleArtistAlbumAndDuration + ? album + : null, + AlbumArtists = [artist], + Artists = [artist], + Title = title, + } + ) + ) as Lyricify.Lyrics.Searchers.NeteaseSearchResult + )?.Id; + if (queryId != null) + { + return (await Lyricify.Lyrics.Helpers.ProviderHelper.NeteaseApi.GetLyric(queryId)) + ?.Lrc + .Lyric; + } + return null; + } + /// /// 本地检索 amll-ttml-db 索引并下载歌词内容 /// diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/en-US/Resources.resw b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/en-US/Resources.resw index 2dbda65..4f0d83f 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/en-US/Resources.resw +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/en-US/Resources.resw @@ -294,6 +294,9 @@ Configure lyrics search providers + + Drag to sort, the lyrics search order will be in the following order + Add @@ -315,8 +318,11 @@ Play using system player - - Log + + Cache + + + Including log files, network lyrics cache Font color @@ -492,4 +498,16 @@ amll-ttml-db + + QQ + + + Netease + + + Kugou + + + Show debug overlay + \ No newline at end of file diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/ja-JP/Resources.resw b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/ja-JP/Resources.resw index 2efc883..4130f05 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/ja-JP/Resources.resw +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/ja-JP/Resources.resw @@ -294,6 +294,9 @@ 歌詞検索プロバイダーを構成します + + ドラッグしてソートすると、歌詞の検索注文は次の順序で行われます + 追加 @@ -315,8 +318,11 @@ システムプレーヤーを使用して再生します - - ログ + + キャッシュ + + + ログファイル、ネットワーク歌詞キャッシュを含む フォントカラー @@ -412,7 +418,7 @@ ドックモード - + デスクトップモード フォント重量 @@ -492,4 +498,16 @@ amll-ttml-db + + QQ + + + Netease + + + Kugou + + + デバッグオーバーレイを表示します + \ No newline at end of file diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/ko-KR/Resources.resw b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/ko-KR/Resources.resw index b83992d..1a532c4 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/ko-KR/Resources.resw +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/ko-KR/Resources.resw @@ -294,6 +294,9 @@ 가사 검색 제공 업체를 구성하십시오 + + 정렬하기 위해 드래그하면 가사 검색 순서는 다음 순서로됩니다. + 추가하다 @@ -315,8 +318,11 @@ 시스템 플레이어를 사용하여 재생하십시오 - - 통나무 + + 은닉처 + + + 로그 파일, 네트워크 가사 캐시 포함 글꼴 색상 @@ -412,7 +418,7 @@ 도크 모드 - + 데스크탑 모드 글꼴 무게 @@ -492,4 +498,16 @@ amll-ttml-db + + QQ + + + Netease + + + Kugou + + + 디버그 오버레이를 표시하십시오 + \ No newline at end of file diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/zh-CN/Resources.resw b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/zh-CN/Resources.resw index 2d7fe51..19c60b2 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/zh-CN/Resources.resw +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/zh-CN/Resources.resw @@ -294,6 +294,9 @@ 配置歌词搜索服务 + + 拖动排序,歌词搜索顺序将按以下顺序 + 添加 @@ -315,8 +318,11 @@ 使用系统播放器播放 - - 日志 + + 缓存 + + + 包括日志文件,网络歌词缓存 字体颜色 @@ -492,4 +498,16 @@ amll-ttml-db + + QQ + + + Netease + + + Kugou + + + 显示调试覆盖层 + \ No newline at end of file diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/zh-TW/Resources.resw b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/zh-TW/Resources.resw index f20595c..e9fef4b 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/zh-TW/Resources.resw +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Strings/zh-TW/Resources.resw @@ -294,6 +294,9 @@ 配置歌詞搜尋服務 + + 拖動排序,歌詞搜索順序將按以下順序 + 添加 @@ -315,8 +318,11 @@ 使用系統播放器播放 - - 紀錄 + + 快取 + + + 包括日誌文件,網絡歌詞緩存 字體顏色 @@ -412,7 +418,7 @@ 停靠模式 - + 桌面模式 字體粗細 @@ -492,4 +498,16 @@ amll-ttml-db + + QQ + + + Netease + + + Kugou + + + 顯示調試覆蓋層 + \ No newline at end of file diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsPageViewModel.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsPageViewModel.cs index e950341..db244da 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsPageViewModel.cs +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsPageViewModel.cs @@ -130,7 +130,7 @@ namespace BetterLyrics.WinUI3.ViewModels /// [ObservableProperty] [NotifyPropertyChangedRecipients] - public partial double LimitedLineWidth { get; set; } = 0.0; + public partial double MaxLyricsWidth { get; set; } = 0.0; /// /// Gets or sets the LyricsFontSize diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsRendererViewModel.Layout.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsRendererViewModel.Layout.cs index 753fa12..fef2ded 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsRendererViewModel.Layout.cs +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsRendererViewModel.Layout.cs @@ -43,9 +43,9 @@ namespace BetterLyrics.WinUI3.ViewModels _rotateAngle %= MathF.PI * 2; } - if (_limitedLineWidthTransition.IsTransitioning) + if (_maxLyricsWidthTransition.IsTransitioning) { - _limitedLineWidthTransition.Update(ElapsedTime); + _maxLyricsWidthTransition.Update(ElapsedTime); _isRelayoutNeeded = true; } @@ -53,9 +53,13 @@ namespace BetterLyrics.WinUI3.ViewModels { ReLayout(control); _isRelayoutNeeded = false; + UpdateCanvasYScrollOffset(control, false); + } + else + { + UpdateCanvasYScrollOffset(control, true); } - UpdateCanvasYScrollOffset(control); UpdateLinesProps(); } @@ -63,7 +67,7 @@ namespace BetterLyrics.WinUI3.ViewModels /// The UpdateCanvasYScrollOffset /// /// The control - private void UpdateCanvasYScrollOffset(ICanvasAnimatedControl control) + private void UpdateCanvasYScrollOffset(ICanvasAnimatedControl control, bool withAnimation) { var currentPlayingLineIndex = GetCurrentPlayingLineIndex(); @@ -93,10 +97,14 @@ namespace BetterLyrics.WinUI3.ViewModels - playingTextLayout.LayoutBounds.Height / 2 ) ?? 0f; - if (!_canvasYScrollTransition.IsTransitioning) + if (withAnimation && !_canvasYScrollTransition.IsTransitioning) { _canvasYScrollTransition.StartTransition(targetYScrollOffset); } + else if (!withAnimation) + { + _canvasYScrollTransition.JumpTo(targetYScrollOffset); + } if (_canvasYScrollTransition.IsTransitioning) { @@ -298,7 +306,7 @@ namespace BetterLyrics.WinUI3.ViewModels control, line.Text, _textFormat, - (float)_limitedLineWidthTransition.Value, + (float)_maxLyricsWidthTransition.Value, (float)control.Size.Height ); diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsRendererViewModel.Messages.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsRendererViewModel.Messages.cs index a610095..0aa335b 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsRendererViewModel.Messages.cs +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsRendererViewModel.Messages.cs @@ -56,6 +56,7 @@ namespace BetterLyrics.WinUI3.ViewModels partial void OnLyricsFontWeightChanged(LyricsFontWeight value) { _textFormat.FontWeight = value.ToFontWeight(); + _isRelayoutNeeded = true; } /// @@ -128,6 +129,10 @@ namespace BetterLyrics.WinUI3.ViewModels { IsCoverOverlayEnabled = message.NewValue; } + else if (message.PropertyName == nameof(SettingsViewModel.IsDebugOverlayEnabled)) + { + _isDebugOverlayEnabled = message.NewValue; + } } else if (message.Sender is LyricsSettingsControlViewModel) { @@ -171,9 +176,9 @@ namespace BetterLyrics.WinUI3.ViewModels { if (message.Sender is LyricsPageViewModel) { - if (message.PropertyName == nameof(LyricsPageViewModel.LimitedLineWidth)) + if (message.PropertyName == nameof(LyricsPageViewModel.MaxLyricsWidth)) { - _limitedLineWidthTransition.StartTransition((float)message.NewValue); + _maxLyricsWidthTransition.StartTransition((float)message.NewValue); } } } diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsRendererViewModel.Renderer.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsRendererViewModel.Renderer.cs index 80e7543..7acd4d3 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsRendererViewModel.Renderer.cs +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsRendererViewModel.Renderer.cs @@ -101,14 +101,18 @@ namespace BetterLyrics.WinUI3.ViewModels out int charLength, out float charProgress ); - //ds.DrawText( - // $"DEBUG: " - // + $"播放行 {currentPlayingLineIndex}, 字符 {charStartIndex}, 长度 {charLength}, 进度 {charProgress}\n" - // + $"可见行 [{_startVisibleLineIndex}, {_endVisibleLineIndex}]" - // + $"当前时刻 {TotalTime}", - // new Vector2(10, 10), - // Colors.Red - //); + + if (_isDebugOverlayEnabled) + { + ds.DrawText( + $"DEBUG: " + + $"播放行 {currentPlayingLineIndex}, 字符 {charStartIndex}, 长度 {charLength}, 进度 {charProgress}\n" + + $"可见行 [{_startVisibleLineIndex}, {_endVisibleLineIndex}]\n" + + $"当前时刻 {TotalTime}", + new Vector2(10, 10), + Colors.Red + ); + } } } @@ -318,18 +322,18 @@ namespace BetterLyrics.WinUI3.ViewModels break; case LyricsAlignmentType.Center: textLayout.HorizontalAlignment = CanvasHorizontalAlignment.Center; - centerX += (float)_limitedLineWidthTransition.Value / 2; + centerX += (float)_maxLyricsWidthTransition.Value / 2; break; case LyricsAlignmentType.Right: textLayout.HorizontalAlignment = CanvasHorizontalAlignment.Right; - centerX += (float)_limitedLineWidthTransition.Value; + centerX += (float)_maxLyricsWidthTransition.Value; break; default: break; } float offsetToLeft = - (float)control.Size.Width - _rightMargin - _limitedLineWidthTransition.Value; + (float)control.Size.Width - _rightMargin - _maxLyricsWidthTransition.Value; // Scale ds.Transform = diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsRendererViewModel.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsRendererViewModel.cs index fb9ab3f..0488b9f 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsRendererViewModel.cs +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/LyricsRendererViewModel.cs @@ -2,28 +2,16 @@ using System; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Numerics; using System.Threading.Tasks; -using BetterInAppLyrics.WinUI3.ViewModels; using BetterLyrics.WinUI3.Enums; using BetterLyrics.WinUI3.Events; using BetterLyrics.WinUI3.Helper; using BetterLyrics.WinUI3.Models; using BetterLyrics.WinUI3.Services; using CommunityToolkit.Mvvm.ComponentModel; -using CommunityToolkit.Mvvm.Messaging; -using CommunityToolkit.Mvvm.Messaging.Messages; -using Microsoft.Graphics.Canvas; -using Microsoft.Graphics.Canvas.Brushes; -using Microsoft.Graphics.Canvas.Effects; using Microsoft.Graphics.Canvas.Text; -using Microsoft.Graphics.Canvas.UI.Xaml; using Microsoft.UI; using Microsoft.UI.Xaml; -using Microsoft.UI.Xaml.Shapes; -using Windows.Foundation; using Windows.Graphics.Imaging; using Windows.UI; @@ -78,6 +66,8 @@ namespace BetterLyrics.WinUI3.ViewModels /// private readonly float _highlightedScale = 1.0f; + private bool _isDebugOverlayEnabled = false; + /// /// Defines the _immersiveBgrTransition /// @@ -96,7 +86,7 @@ namespace BetterLyrics.WinUI3.ViewModels /// /// Defines the _limitedLineWidthTransition /// - private readonly ValueTransition _limitedLineWidthTransition = new( + private readonly ValueTransition _maxLyricsWidthTransition = new( initialValue: 0f, durationSeconds: 0.8f, interpolator: (from, to, progress) => to diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/SettingsViewModel.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/SettingsViewModel.cs index 49b7f95..036b74f 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/SettingsViewModel.cs +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/ViewModels/SettingsViewModel.cs @@ -1,5 +1,12 @@ // 2025/6/23 by Zhe Fang +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Threading.Tasks; using BetterLyrics.WinUI3.Enums; using BetterLyrics.WinUI3.Helper; using BetterLyrics.WinUI3.Messages; @@ -10,13 +17,6 @@ using CommunityToolkit.Mvvm.Input; using CommunityToolkit.Mvvm.Messaging; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Threading.Tasks; using Windows.ApplicationModel.Core; using Windows.Globalization; using Windows.Media; @@ -102,6 +102,10 @@ namespace BetterLyrics.WinUI3.ViewModels [ObservableProperty] public partial AutoStartWindowType AutoStartWindowType { get; set; } + [ObservableProperty] + [NotifyPropertyChangedRecipients] + public partial bool IsDebugOverlayEnabled { get; set; } = false; + /// /// Gets or sets the BackdropType /// @@ -360,9 +364,9 @@ namespace BetterLyrics.WinUI3.ViewModels /// The OpenLogFolder /// [RelayCommand] - private void OpenLogFolder() + private void OpenCacheFolder() { - OpenFolderInFileExplorer(AppInfo.LogDirectory); + OpenFolderInFileExplorer(AppInfo.CacheFolder); } /// diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/LyricsPage.xaml b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/LyricsPage.xaml index 383bb45..c4d2d56 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/LyricsPage.xaml +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/LyricsPage.xaml @@ -93,45 +93,52 @@ Grid.Row="1" SizeChanged="CoverArea_SizeChanged"> - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -179,7 +186,7 @@ x:Name="TitleTextBlock" Behavior="Bouncing" FontSize="{StaticResource TitleTextBlockFontSize}" - FontWeight="SemiBold" + FontWeight="Bold" Foreground="{ThemeResource TextFillColorPrimaryBrush}" Text="{x:Bind ViewModel.SongInfo.Title, Mode=OneWay}" /> @@ -222,7 +229,6 @@ diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/LyricsPage.xaml.cs b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/LyricsPage.xaml.cs index 5528ced..3f83fca 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/LyricsPage.xaml.cs +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/LyricsPage.xaml.cs @@ -1,10 +1,10 @@ // 2025/6/23 by Zhe Fang +using System; using BetterLyrics.WinUI3.ViewModels; using CommunityToolkit.Mvvm.DependencyInjection; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; -using System; // To learn more about WinUI, the WinUI project structure, // and more about our project templates, see: http://aka.ms/winui-project-info. @@ -102,7 +102,7 @@ namespace BetterLyrics.WinUI3.Views /// The e private void LyricsPlaceholderGrid_SizeChanged(object sender, SizeChangedEventArgs e) { - ViewModel.LimitedLineWidth = e.NewSize.Width; + ViewModel.MaxLyricsWidth = e.NewSize.Width; } /// diff --git a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/SettingsPage.xaml b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/SettingsPage.xaml index 002ab1c..8d29d15 100644 --- a/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/SettingsPage.xaml +++ b/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Views/SettingsPage.xaml @@ -481,8 +481,11 @@