diff --git a/osu.Game/Overlays/Direct/PlayButton.cs b/osu.Game/Overlays/Direct/PlayButton.cs index 9f36d5acb7..44e24d8157 100644 --- a/osu.Game/Overlays/Direct/PlayButton.cs +++ b/osu.Game/Overlays/Direct/PlayButton.cs @@ -173,8 +173,9 @@ namespace osu.Game.Overlays.Direct if (trackLoader != d) return; Preview = d?.Preview; - Playing.TriggerChange(); + updatePreviewTrack(Playing); loading = false; + Add(trackLoader); }); } diff --git a/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs b/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs index 31433e64b3..3fec9d8697 100644 --- a/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs +++ b/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs @@ -59,13 +59,13 @@ namespace osu.Game.Overlays.Profile.Sections.Beatmaps panel.PreviewPlaying.ValueChanged += isPlaying => { - if (!isPlaying) return; + StopPlayingPreview(); - BeganPlayingPreview?.Invoke(this); - if (currentlyPlaying != null && currentlyPlaying != panel) - StopPlayingPreview(); - - currentlyPlaying = panel; + if (isPlaying) + { + BeganPlayingPreview?.Invoke(this); + currentlyPlaying = panel; + } }; } }; @@ -75,8 +75,9 @@ namespace osu.Game.Overlays.Profile.Sections.Beatmaps public void StopPlayingPreview() { - if (currentlyPlaying != null) - currentlyPlaying.PreviewPlaying.Value = false; + if (currentlyPlaying == null) return; + currentlyPlaying.PreviewPlaying.Value = false; + currentlyPlaying = null; } } } diff --git a/osu.Game/Overlays/Profile/Sections/BeatmapsSection.cs b/osu.Game/Overlays/Profile/Sections/BeatmapsSection.cs index 78a3bd7468..92abd20f93 100644 --- a/osu.Game/Overlays/Profile/Sections/BeatmapsSection.cs +++ b/osu.Game/Overlays/Profile/Sections/BeatmapsSection.cs @@ -25,13 +25,10 @@ namespace osu.Game.Overlays.Profile.Sections foreach (var paginatedBeatmapContainer in Children.OfType()) { - paginatedBeatmapContainer.BeganPlayingPreview += beatmapContainer => + paginatedBeatmapContainer.BeganPlayingPreview += _ => { foreach (var bc in Children.OfType()) - { - if (bc != beatmapContainer) - bc.StopPlayingPreview(); - } + bc.StopPlayingPreview(); }; } }