From cf01843ff6c5491815e125201767c14ac05b37ca Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Thu, 29 Jul 2021 00:04:13 -0400 Subject: [PATCH] mpdmenu: Add thumbnails to standalone recording menus. I think in typical usage cover images for standalone recordings will be embedded and different for each file. It's more like a list of 1-track albums rather than a list of tracks from the same album, so probably nice to add the images. --- mpdmenu.pl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mpdmenu.pl b/mpdmenu.pl index e536470..71613c5 100755 --- a/mpdmenu.pl +++ b/mpdmenu.pl @@ -776,6 +776,14 @@ if ($mode eq "top") { $menu //= "MenuMPDRecordings"; my @tracks = sort { $a->{Title} cmp $b->{Title} } grep { $_->{Album} eq $albumname } @recs; + + # Show thumbnails for standalone recordings + my @thumbs = get_item_thumbnails({ small => 1 }, + map { $_->{file} } @tracks); + foreach my $entry (@tracks) { + $entry->{thumb} = shift @thumbs; + } + my @notqueued = update_entry_ids(@tracks); fvwm_cmd("AddToMenu", $menu); -- 2.43.2