diff --git a/.gitignore b/.gitignore index 8afdcb6..d1a58e4 100644 --- a/.gitignore +++ b/.gitignore @@ -219,7 +219,7 @@ rcf/ # Windows Store app package directories and files AppPackages/ BundleArtifacts/ -Package.StoreAssociation.xml +# Package.StoreAssociation.xml _pkginfo.txt *.appx *.appxbundle diff --git a/DanmakuPlayer/App.xaml.cs b/DanmakuPlayer/App.xaml.cs index 88961c2..4b4adce 100644 --- a/DanmakuPlayer/App.xaml.cs +++ b/DanmakuPlayer/App.xaml.cs @@ -23,13 +23,13 @@ public partial class App : Application public App() { - RegisterUnhandledExceptionHandler(); - this.UseSegoeMetrics(); + _ = this.UseSegoeMetrics(); SettingsValueConverter.Context = SettingsSerializeContext.Default; Environment.SetEnvironmentVariable("WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS", $"--remote-debugging-port={RemoteDebuggingPort}"); - InitializeComponent(); AppContext.Initialize(); + RegisterUnhandledExceptionHandler(); HttpClientHelper.Initialize(); + InitializeComponent(); } protected override void OnLaunched(LaunchActivatedEventArgs args) @@ -59,8 +59,7 @@ protected override void OnLaunched(LaunchActivatedEventArgs args) private void RegisterUnhandledExceptionHandler() { - _logger = new FileLogger(@"C:\Users\poker\AppData\Local\Packages\PokerKo.DanmakuPlayer_0wpjzgvbyjvyr\LocalState\Logs"); - // var logger = new FileLogger(Path.Combine(AppContext.AppLocalFolder, "Logs")); + _logger = new FileLogger(Path.Combine(AppContext.AppLocalFolder, "Logs")); DebugSettings.BindingFailed += (o, e) => { _logger.LogWarning(e.Message, null); diff --git a/DanmakuPlayer/AppConfig.cs b/DanmakuPlayer/AppConfig.cs index a8158b1..d16f066 100644 --- a/DanmakuPlayer/AppConfig.cs +++ b/DanmakuPlayer/AppConfig.cs @@ -5,14 +5,9 @@ namespace DanmakuPlayer; -[GenerateConstructor] -public partial record AppConfig +[GenerateConstructor(CallParameterlessConstructor = true)] +public partial record AppConfig() { - public AppConfig() - { - - } - #region 渲染设置 /// diff --git a/DanmakuPlayer/Package.StoreAssociation.xml b/DanmakuPlayer/Package.StoreAssociation.xml new file mode 100644 index 0000000..0a1a4ae --- /dev/null +++ b/DanmakuPlayer/Package.StoreAssociation.xml @@ -0,0 +1,374 @@ + + + CN=D5BE94D7-0E23-4B10-BC6A-5550D9783A2A + PokerKo + MSA + http://www.w3.org/2001/04/xmlenc#sha256 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PokerKo.DanmakuPlayer + + Danmaku Player + + + + PokerKo.EncodeConverter + PokerKo.4454907E5DDB5 + + + \ No newline at end of file diff --git a/DanmakuPlayer/Views/Controls/BackgroundPanel.xaml.cs b/DanmakuPlayer/Views/Controls/BackgroundPanel.xaml.cs index f095013..62edbee 100644 --- a/DanmakuPlayer/Views/Controls/BackgroundPanel.xaml.cs +++ b/DanmakuPlayer/Views/Controls/BackgroundPanel.xaml.cs @@ -11,7 +11,6 @@ using DanmakuPlayer.Resources; using DanmakuPlayer.Services; using DanmakuPlayer.Services.DanmakuServices; -using DanmakuPlayer.Views.Converters; using DanmakuPlayer.Views.ViewModels; using Microsoft.Graphics.Canvas.UI; using Microsoft.Graphics.Canvas.UI.Xaml; @@ -320,7 +319,7 @@ await WebView.LockOperationsAsync(async operations => private void TimeTextTapped(object sender, TappedRoutedEventArgs e) { - TimeText.Text = DoubleToTimeTextConverter.ToTime(Vm.Time); + TimeText.Text = C.ToTime(Vm.Time); Vm.EditingTime = true; } diff --git a/DanmakuPlayer/Views/Controls/VideoLocatorDisplay.cs b/DanmakuPlayer/Views/Controls/VideoLocatorDisplay.cs index 03a1959..5543f4d 100644 --- a/DanmakuPlayer/Views/Controls/VideoLocatorDisplay.cs +++ b/DanmakuPlayer/Views/Controls/VideoLocatorDisplay.cs @@ -29,7 +29,7 @@ namespace DanmakuPlayer.Views.Controls; public class VideoLocatorDisplay { - public override string ToString() => DoubleToTimeTextConverter.ToTime(Duration); + public override string ToString() => C.ToTime(Duration); public ILocator Video { get; set; } = null!; diff --git a/DanmakuPlayer/Views/Converters/DoubleToTimeTextConverter.cs b/DanmakuPlayer/Views/Converters/DoubleToTimeTextConverter.cs index a2ee16e..9397649 100644 --- a/DanmakuPlayer/Views/Converters/DoubleToTimeTextConverter.cs +++ b/DanmakuPlayer/Views/Converters/DoubleToTimeTextConverter.cs @@ -1,4 +1,5 @@ using System; +using DanmakuPlayer.Views.Controls; using Microsoft.UI.Xaml.Data; using WinUI3Utilities; @@ -6,13 +7,7 @@ namespace DanmakuPlayer.Views.Converters; public class DoubleToTimeTextConverter : IValueConverter { - public object Convert(object value, Type targetType, object parameter, string language) => ToTime(value.To()); + public object Convert(object value, Type targetType, object parameter, string language) => C.ToTime(value.To()); public object ConvertBack(object value, Type targetType, object parameter, string language) => ThrowHelper.InvalidCast(); - - public static string ToTime(double sec) - { - var time = TimeSpan.FromSeconds(sec); - return time is { Hours: 0 } ? time.ToString(@"mm\:ss") : time.ToString(@"hh\:mm\:ss"); - } } diff --git a/README.md b/README.md index 89bf7f1..19144fb 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ logo -# DanmakuPlayer +# Danmaku Player [store-logo](https://apps.microsoft.com/detail/Danmaku%20Player/9pmcjd6flbzs?launch=true&mode=mini)