spezifisch / stmps

Subsonic Terminal Music Player S
GNU General Public License v3.0
19 stars 6 forks source link

Implements #25, display song info. #46

Closed xxxserxxx closed 1 month ago

xxxserxxx commented 1 month ago

This is implemented as a side-bar column in the play queue:

capture

Upsides:

  1. You'll notice that when the song title is really long, this format can help, as otherwise most of the information (artist, duration) gets pushed off the screen by the title. Users can scroll right, of course, but this keeps all of the song info visible at once.
  2. There's space to display the cover art. And I really want to display the cover art; Subsonic's API provides it, and there are several Go applications that raster images to terminals that can be worked from. In any case, this approach leaves that option open.
  3. There's more space for displaying other metadata (CD number, release year, genre, etc.)
  4. These sorts of changes to the metadata column are relatively easy, because the contents are formatted by a text/template (at the end of page_queue.go). If it weren't for the fact that the Song entity is pretty anemic and doesn't capture all of the information the server provides, adding more data would be a mere matter of adding lines to the template. It'd be really easy to capture this extra metadata, but I wanted to keep this PR relatively constrained.

The downside is that it takes up space.

I also considered just adding more columns to the queue; namely, the Album and Track. The pro of doing this is that it keeps the UI clean; the downside is that there's only so much information you can squish into that table without forcing the user to scroll around to see things.

I briefly considered implementing both and allowing the user to choose which with a flag, but that seems better left to a different PR.

It might be useful to add a hotkey to allow the user to hide the metadata column; I understand how to hide pages in tview, but figuring out how to hide elements would -- while not necessarily hard -- have required significantly more time on my end in self-education.

I'm sending this as you've included this item in milestone #1. I'm going to add a ticket to capture more of the song metadata the servers are providing and add them to the template; another one for displaying cover art; and another for hotkey hiding/showing the metadata column.

xxxserxxx commented 1 month ago

I have a commit pending to display the DiscNumber in the song info, but as the PRs stack up I'm increasingly concerned about merge conflicts -- and especially here where I had to rename a variable that was renamed in a different branch. After these are merged, I'll create a separate PR for the song info change.