From: Nick Bowler Date: Thu, 29 Jul 2021 04:04:13 +0000 (-0400) Subject: mpdmenu: Add thumbnails to standalone recording menus. X-Git-Url: https://git.draconx.ca/gitweb/mpdhacks.git/commitdiff_plain/cf01843ff6c5491815e125201767c14ac05b37ca 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. --- 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);