mirror of
https://github.com/jayfunc/BetterLyrics.git
synced 2026-01-12 10:54:55 +08:00
fix: auto play only be valid when first opening gallery window
This commit is contained in:
@@ -130,11 +130,6 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
|
||||
_libWatcherService = libWatcherService;
|
||||
_libWatcherService.MusicLibraryFilesChanged += LibWatcherService_MusicLibraryFilesChanged;
|
||||
|
||||
if (AppSettings.MusicGallerySettings.AutoPlay)
|
||||
{
|
||||
_ = PlayTrackAtAsync(AppSettings.MusicGallerySettings.PlayQueueIndex);
|
||||
}
|
||||
}
|
||||
|
||||
private void TrackPlayingQueue_CollectionChanged(object? sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
|
||||
|
||||
@@ -178,6 +178,7 @@ namespace BetterLyrics.WinUI3.Views
|
||||
private void Page_Unloaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ViewModel.CancelRefreshSongs();
|
||||
ViewModel.StopTrackCommand.Execute(null);
|
||||
}
|
||||
|
||||
private void PlaylistFavButton_Click(object sender, RoutedEventArgs e)
|
||||
@@ -270,6 +271,11 @@ namespace BetterLyrics.WinUI3.Views
|
||||
|
||||
private void Page_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var settings = ViewModel.AppSettings.MusicGallerySettings;
|
||||
if (settings.AutoPlay)
|
||||
{
|
||||
_ = ViewModel.PlayTrackAtAsync(settings.PlayQueueIndex);
|
||||
}
|
||||
ScrollToPlayingItem();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user