]> git.draconx.ca Git - mpdhacks.git/commitdiff
mpdmenu: Add thumbnails to standalone recording menus.
authorNick Bowler <nbowler@draconx.ca>
Thu, 29 Jul 2021 04:04:13 +0000 (00:04 -0400)
committerNick Bowler <nbowler@draconx.ca>
Thu, 29 Jul 2021 04:04:13 +0000 (00:04 -0400)
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

index e53647065a0a3a5d50596b83fd37112ef9f7f3d4..71613c5fb015d8a9e5489999f0934c88b9850454 100755 (executable)
@@ -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);