Merge branch 'main' into feature/new-playlist-btn

This commit is contained in:
Drew Weymouth
2025-09-27 07:50:02 -07:00
committed by GitHub
60 changed files with 324 additions and 196 deletions
+1 -4
View File
@@ -62,10 +62,7 @@ func (a *albumsPageAdapter) Route() controller.Route { return controller.AlbumsR
func (a *albumsPageAdapter) SortOrders() ([]string, int) {
orders := a.mp.AlbumSortOrders()
sortOrder := slices.Index(orders, a.cfg.SortOrder)
if sortOrder < 0 {
sortOrder = 0
}
sortOrder := max(slices.Index(orders, a.cfg.SortOrder), 0)
return util.LocalizeSlice(orders), sortOrder
}
+1 -1
View File
@@ -486,7 +486,7 @@ type ArtistPageHeader struct {
menuBtn *widget.Button
container *fyne.Container
fullSizeCoverFetching bool
//shareMenuItem *fyne.MenuItem
// shareMenuItem *fyne.MenuItem
}
func NewArtistPageHeader(page *ArtistPage) *ArtistPageHeader {
+1 -4
View File
@@ -47,10 +47,7 @@ func (a *artistsPageAdapter) Route() controller.Route { return controller.Artist
func (a *artistsPageAdapter) SortOrders() ([]string, int) {
orders := a.mp.ArtistSortOrders()
sortOrder := slices.Index(orders, a.cfg.SortOrder)
if sortOrder < 0 {
sortOrder = 0
}
sortOrder := max(slices.Index(orders, a.cfg.SortOrder), 0)
return util.LocalizeSlice(orders), sortOrder
}
+3 -2
View File
@@ -204,7 +204,8 @@ func NewGenreList(sorting widgets.ListHeaderSort) *GenreList {
a.hdr = widgets.NewListHeader([]widgets.ListColumn{
{Text: lang.L("Name"), Alignment: fyne.TextAlignLeading, CanToggleVisible: false},
{Text: albumCount, Alignment: fyne.TextAlignTrailing, CanToggleVisible: false},
{Text: trackCount, Alignment: fyne.TextAlignTrailing, CanToggleVisible: false}},
{Text: trackCount, Alignment: fyne.TextAlignTrailing, CanToggleVisible: false},
},
a.columnsLayout)
a.hdr.SetSorting(sorting)
a.hdr.OnColumnSortChanged = a.onSorted
@@ -261,7 +262,7 @@ func (g *GenreList) doSortGenres() {
return
}
switch g.sorting.ColNumber {
case 0: //Name
case 0: // Name
g.stringSort(func(g *mediaprovider.Genre) string { return g.Name })
case 1: // Album Count
g.intSort(func(g *mediaprovider.Genre) int { return g.AlbumCount })
+4 -3
View File
@@ -360,8 +360,10 @@ func (a *NowPlayingPage) updateLyrics() {
// set the widget to an empty (not nil) lyric during fetch
// to keep it from showing "Lyrics not available"
a.lyricsViewer.DisableTapToSeek()
a.lyricsViewer.SetLyrics(&mediaprovider.Lyrics{Synced: true,
Lines: []mediaprovider.LyricLine{{Text: ""}}})
a.lyricsViewer.SetLyrics(&mediaprovider.Lyrics{
Synced: true,
Lines: []mediaprovider.LyricLine{{Text: ""}},
})
tr, _ := a.nowPlaying.(*mediaprovider.Track)
go a.fetchLyrics(ctx, tr)
}
@@ -482,7 +484,6 @@ func (a *NowPlayingPage) OnPlayTimeUpdate(curTime, _ float64, seeked bool) {
func (a *NowPlayingPage) currentTracklistOrNil() *widgets.PlayQueueList {
if a.tabs != nil {
switch a.tabs.SelectedIndex() {
case 0: /*queue*/
return a.queueList
+3 -2
View File
@@ -400,7 +400,8 @@ func (p *PlaylistList) buildHeaderAndLayout() {
{Text: lang.L("Name"), Alignment: fyne.TextAlignLeading, CanToggleVisible: false},
{Text: lang.L("_Description"), Alignment: fyne.TextAlignLeading, CanToggleVisible: false},
{Text: lang.L("Owner"), Alignment: fyne.TextAlignLeading, CanToggleVisible: false},
{Text: trackCount, Alignment: fyne.TextAlignTrailing, CanToggleVisible: false}}, p.columnsLayout)
{Text: trackCount, Alignment: fyne.TextAlignTrailing, CanToggleVisible: false},
}, p.columnsLayout)
p.header.SetSorting(p.sorting)
p.header.OnColumnSortChanged = p.onSorted
}
@@ -433,7 +434,7 @@ func (p *PlaylistList) doSortPlaylists() {
return
}
switch p.sorting.ColNumber {
case 0: //Name
case 0: // Name
p.stringSort(func(p *mediaprovider.Playlist) string { return p.Name })
case 1: // Description
p.stringSort(func(p *mediaprovider.Playlist) string { return p.Description })
+4 -4
View File
@@ -253,7 +253,8 @@ func NewRadioList(nowPlayingIDPtr *string) *RadioList {
a.ExtendBaseWidget(a)
a.hdr = widgets.NewListHeader([]widgets.ListColumn{
{Text: lang.L("Name"), Alignment: fyne.TextAlignLeading, CanToggleVisible: false},
{Text: lang.L("Home Page"), Alignment: fyne.TextAlignLeading, CanToggleVisible: false}},
{Text: lang.L("Home Page"), Alignment: fyne.TextAlignLeading, CanToggleVisible: false},
},
a.columnsLayout)
a.hdr.DisableSorting = true
a.list = widgets.NewFocusList(
@@ -299,9 +300,8 @@ func NewRadioList(nowPlayingIDPtr *string) *RadioList {
row.IsPlaying = isPlaying
row.nameLabel.Segments[0].(*widget.TextSegment).Style.TextStyle.Bold = isPlaying
if isPlaying {
row.Content.(*fyne.Container).Objects[0] =
container.NewBorder(nil, nil, a.playingIcon, nil,
container.New(layout.NewCustomPaddedLayout(0, 0, -5, 0), row.nameLabel))
row.Content.(*fyne.Container).Objects[0] = container.NewBorder(nil, nil, a.playingIcon, nil,
container.New(layout.NewCustomPaddedLayout(0, 0, -5, 0), row.nameLabel))
} else {
row.Content.(*fyne.Container).Objects[0] = row.nameLabel
}