Add playlists thumbnails to the menu when selecting #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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/
asPLAYLIST_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.