From 467a6edf4cffd3c2caab54d38c99fb59bfe38d5b Mon Sep 17 00:00:00 2001 From: Simon Garrelou Date: Fri, 9 Dec 2022 17:36:01 +0100 Subject: Change song display --- src/footer.go | 4 ++-- src/page_artists.go | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/footer.go b/src/footer.go index 1db1843..96b0aa3 100644 --- a/src/footer.go +++ b/src/footer.go @@ -7,8 +7,8 @@ func (a *app) updateFooter() { case "playqueue": a.footer.SetText("[blue]l:[yellow] Next song [blue]p:[yellow] Toggle pause [blue]d:[yellow] Remove [blue]j:[yellow] Move up [blue]k:[yellow] Move down") case "playlists": - a.footer.SetText("Come back later!") + a.footer.SetText("") case "config": - a.footer.SetText("Configuration page") + a.footer.SetText("") } } diff --git a/src/page_artists.go b/src/page_artists.go index 104fdc7..6cbaee1 100644 --- a/src/page_artists.go +++ b/src/page_artists.go @@ -2,7 +2,6 @@ package src import ( "fmt" - "time" "github.com/delucks/go-subsonic" "github.com/gdamore/tcell/v2" @@ -41,7 +40,7 @@ func (a *app) artistsPage() tview.Primitive { // Songs list for the selected album a.songsList = tview.NewList() - a.songsList.ShowSecondaryText(false) + a.songsList.ShowSecondaryText(false).SetHighlightFullLine(true) a.songsList.SetBorderAttributes(tcell.AttrDim).SetBorder(true) // Change the left-right keys to switch between the panels @@ -124,9 +123,9 @@ func (a *app) loadAlbumInPanel(id string) error { songsCopy := make([]*subsonic.Child, len(songs)) copy(songsCopy, songs) - dur := time.Duration(song.Duration) * time.Second + txt := fmt.Sprintf("%-2d - %s", song.Track, song.Title) - a.songsList.InsertItem(0, fmt.Sprintf("%-10s %d - %s", fmt.Sprintf("[%s]", dur.String()), song.Track, song.Title), "", 0, func() { + a.songsList.InsertItem(0, txt, "", 0, func() { a.playQueue.Clear() for _, s := range songsCopy { a.playQueue.Append(s) -- cgit v1.2.3