mirror of
https://github.com/jayfunc/BetterLyrics.git
synced 2026-01-12 10:54:55 +08:00
fix: music gallery init
This commit is contained in:
@@ -10,7 +10,7 @@ namespace BetterLyrics.WinUI3.Models
|
||||
[ObservableProperty][NotifyPropertyChangedRecipients] public partial bool IsEnabled { get; set; }
|
||||
[ObservableProperty][NotifyPropertyChangedRecipients] public partial LyricsSearchProvider Provider { get; set; }
|
||||
[ObservableProperty][NotifyPropertyChangedRecipients] public partial bool IsMatchingThresholdOverwritten { get; set; } = false;
|
||||
[ObservableProperty][NotifyPropertyChangedRecipients] public partial int MatchingThreshold { get; set; } = 0;
|
||||
[ObservableProperty][NotifyPropertyChangedRecipients] public partial int MatchingThreshold { get; set; } = 40;
|
||||
|
||||
public LyricsSearchProviderInfo() { }
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace BetterLyrics.WinUI3.Models
|
||||
[ObservableProperty][NotifyPropertyChangedRecipients] public partial bool AutoShowOrHideWindow { get; set; } = false;
|
||||
[ObservableProperty][NotifyPropertyChangedRecipients] public partial TitleBarArea TitleBarArea { get; set; } = TitleBarArea.Top;
|
||||
|
||||
[JsonIgnore][ObservableProperty] public partial bool IsOpened { get; set; } = false;
|
||||
[JsonIgnore][ObservableProperty][NotifyPropertyChangedRecipients] public partial bool IsOpened { get; set; } = false;
|
||||
|
||||
[JsonIgnore] public DispatcherQueueTimer? VisibilityTimer { get; set; }
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ namespace BetterLyrics.WinUI3.Services.MediaSessionsService
|
||||
{
|
||||
if (PlayerIDHelper.IsBetterLyrics(found?.Provider))
|
||||
{
|
||||
return true;
|
||||
return found?.IsEnabled ?? true;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -202,7 +202,11 @@ namespace BetterLyrics.WinUI3.Services.MediaSessionsService
|
||||
private void MediaManager_OnAnyTimelinePropertyChanged(MediaManager.MediaSession? mediaSession, GlobalSystemMediaTransportControlsSessionTimelineProperties? timelineProperties)
|
||||
{
|
||||
if (!_mediaManager.IsStarted) return;
|
||||
if (mediaSession == null) return;
|
||||
if (mediaSession == null)
|
||||
{
|
||||
CurrentPosition = TimeSpan.Zero;
|
||||
return;
|
||||
}
|
||||
|
||||
var desiredSession = GetCurrentSession();
|
||||
|
||||
@@ -226,7 +230,11 @@ namespace BetterLyrics.WinUI3.Services.MediaSessionsService
|
||||
_dispatcherQueue.TryEnqueue(DispatcherQueuePriority.Low, (() =>
|
||||
{
|
||||
if (!_mediaManager.IsStarted) return;
|
||||
if (mediaSession == null) return;
|
||||
if (mediaSession == null)
|
||||
{
|
||||
CurrentIsPlaying = false;
|
||||
return;
|
||||
}
|
||||
|
||||
var desiredSession = GetCurrentSession();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user