spezifisch / stmps

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

Add a more complex caching mechanism which loads assets concurrently #66

Open xxxserxxx opened 1 month ago

xxxserxxx commented 1 month ago

As discussed: this adds a new structure, Queue, which can load queue up loading assets in the background. It replaces the current album art queue, and has been tested against Navidrome and gonic. You can see it at work if you load up the queue with songs from different albums and hold down the scroll key; at times the "logo" will flash for a song, and if you return to the song it'll usually have the art.

You are seeing > second long image load times; I'm seeing sub-second times, even with Navidrome. I am therefore guessing that your server is on the WAN, whereas mine are on my LAN, and the latency differences are network related and not server software related.

I'll be interested to hear how this behaves for you, as I have difficulty triggering slow image loading times, even on albums with large (> 1k×1k) image art files.

In case we need to use the queue for other types of assets (lyrics are in my crosshairs), I made it a generic container.

xxxserxxx commented 1 month ago

The container for the markdownlint job is failing; I haven't changed it, so I'm not sure what's going on there. It's not a linting error (I didn't change the README in this commit), it's an actual failure setting up the workflow.

spezifisch commented 1 month ago

The container for the markdownlint job is failing; I haven't changed it, so I'm not sure what's going on there. It's not a linting error (I didn't change the README in this commit), it's an actual failure setting up the workflow.

Looks like Github is having hiccups again. I restarted the job and it ran through without a hitch.

spezifisch commented 1 month ago

What milestone do you think this should be?

xxxserxxx commented 1 month ago

What milestone do you think this should be?

I think v1.1.0, where you put it, is fine. It's certainly more complex than a simple in-memory cache; OTOH, it's one of the few files that has 100% code coverage in unit tests.

If we notice memory issues, we can just push 1.1.0 out earlier; this does address the potential ever-growing image queue issue.