修正BUG(切換頁面顯示錯誤)

This commit is contained in:
jasonchenwork 2025-05-22 10:24:21 +08:00
parent 743f774247
commit 33b6883df2
2 changed files with 7 additions and 3 deletions

View File

@ -52,6 +52,7 @@ namespace DualScreenDemo
}
}
}
private bool _isShowingSinger = true;
private List<SongData> currentSongList = new List<SongData>();
public List<SongData> get_currentSongList(){
return currentSongList;
@ -145,7 +146,7 @@ namespace DualScreenDemo
{
currentPageIndex++;
// 如果歌單為0(沒有歌單),則刷新歌手列表
if(currentSongList.Count == 0)
if(_isShowingSinger)
{
RefreshDisplayBase_Singer();
}
@ -173,6 +174,7 @@ namespace DualScreenDemo
public void LoadSongs(List<SongData> songs, bool clearHistory = false)
{
_isShowingSinger = false;
currentSongList = songs;
currentArtistList.Clear();
currentPageIndex = 0;
@ -184,8 +186,9 @@ namespace DualScreenDemo
public void LoadSingers(List<Artist> artists)
{
_isShowingSinger = true;
currentArtistList = artists;
//currentSongList.Clear();
// currentSongList.Clear();
currentPageIndex = 0;
totalPages = (int)Math.Ceiling(artists.Count / (double)itemsPerPage);
RefreshDisplayBase_Singer();
@ -193,6 +196,7 @@ namespace DualScreenDemo
public void LoadPlayedSongs(List<SongData> songs, List<PlayState> states)
{
_isShowingSinger = false;
currentSongList = songs;
currentArtistList.Clear();
currentPageIndex = 0;

View File

@ -2573,7 +2573,7 @@ namespace DualScreenDemo
closeQRCodeButton.Visible = false;
}
multiPagePanel.LoadPlayedSongs(currentSongList, playStates);
multiPagePanel.LoadPlayedSongs(playedSongsHistory, playStates);
}
}
}