Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add playlists thumbnails to the menu when selecting #5

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ewen-lbh
Copy link

screenshot

Using theme Launchpad


It's not very well documented, but you can give a rofi selection row an icon by appending \0icon\x1fPATH_TO_ICON to a choice.

Since we have access to thumbnail URLs through the API, I added some code that downloads playlist thumbnails to a cache, and uses them.

It notifies the user that thumbnails are being downloaded, as the first use will take some time (all of the thumbnails will need to be cached).
On subsequent uses, the images will already be downloaded and thus will not need to be downloaded.
Downloads will only occur when new playlist(s) have been created since the last run.

As playlist thumbnails can change, the user can clear the downloaded thumbnails with --clear-cache to download them again.
(a way to periodically refresh thumbnails based on the last download time can be quite easily implemented, but I'm not sure if it is worth the added delays when thumbnails eventually get re-downloaded)

The thumbnails are stored in $HOME/.cache/rofi-spotify/thumbs/ as PLAYLIST_ID.png. Here again, it should be pretty simple to make this download location customizable in the configuration.

The only thing I still need to do is update the documentation.

It turns out that empty playlists have no images (not even generated
ones, as there's no album artworks to generate them from)

This edge case is dealt with by simply not showing icons for those.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant