Closed xxxserxxx closed 1 month ago
Teaser:
This must be pulled instead of #25, or after #25 has been merged. It's built on top of #25. I am issuing the PR against
main
only because #25 isn't available in your repo; if you merge #25 first, this PR is much smaller -- it was forked off #25.
Oops, I messed it up. Sorry, I will clean up after merging the other PRs.
Note
This must be pulled instead of #25, or after #25 has been merged. It's built on top of #25. I am issuing the PR against
main
only because #25 isn't available in your repo; if you merge #25 first, this PR is much smaller -- it was forked off #25.This implements #48 in the most simple way: with
tview.Image
. The tview dithering algorithm isn't particularly pretty, and it doesn't take advantage of any of the possible special terminal capabilities like kitty or SIXEL, but it does work and is fairly straightforward, and it doesn't pull in any more external dependencies.There are some things to note:
content-type
returned by the server.docs/logo.md
; there's not much to it, and I have no ego invested in this logo, so feel free to replace it with... anything. As long as it's an image.tview.Image
results should take far less memory than whatever source images servers return, but this code caches the source. On the upside, if users resize their terminals, the cover art automatically looks better because the rendering quality is dependent on terminal size. On the downside, we're keeping a bunch of bits we will never use if the terminal isn't resized. What we probably ultimately want to do is (1) store the reduced rasterized images, (2) drop all of the cached images if the terminal is resized, which would (3) re-fetch the images when requested. And we'd still probably want to constrain the cached image size, so... it's some work.I am not much concerned about the data fetch bandwidth, because we are ultimately streaming far greater amounts of bytes worth of music. The album art is insignificant overhead.
I have merged all of my PRs on top of your current
main
, in order of PR, and there's only one conflict because I fixed a linting issue in two different branches. It's an easy resolution.