refactor: get rid of browsingpane as play album mediator

This commit is contained in:
Drew Weymouth
2023-02-10 18:02:08 -08:00
parent 39f5f09adf
commit 22e9287608
4 changed files with 20 additions and 39 deletions
-9
View File
@@ -31,10 +31,6 @@ type Searchable interface {
SearchWidget() fyne.Focusable
}
type CanPlayAlbum interface {
SetPlayAlbumCallback(func(albumID string, startingTrack int))
}
type CanShowNowPlaying interface {
OnSongChange(song *subsonic.Child)
}
@@ -98,11 +94,6 @@ func (b *BrowsingPane) doSetPage(p Page) bool {
return false
}
b.curPage = p
if pa, ok := p.(CanPlayAlbum); ok {
pa.SetPlayAlbumCallback(func(albumID string, firstTrack int) {
_ = b.app.PlaybackManager.PlayAlbum(albumID, firstTrack)
})
}
if np, ok := p.(CanShowNowPlaying); ok {
np.OnSongChange(b.app.PlaybackManager.NowPlaying())
}