From 298442ad553cc0309818e7a435b1e349bc077d47 Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Sun, 25 Jul 2021 12:58:18 -0400 Subject: [PATCH] mpdexec: Add support for readpicture command in download mode. --- mpdexec.pl | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/mpdexec.pl b/mpdexec.pl index 4d25ead..72f81fe 100755 --- a/mpdexec.pl +++ b/mpdexec.pl @@ -1,6 +1,6 @@ #!/usr/bin/env perl # -# Copyright © 2012,2019-2020 Nick Bowler +# Copyright © 2012,2019-2021 Nick Bowler # # Send commands to MPD. Each command-line argument is quoted as necessary # so it appears as a single argument at the protocol level. The result is @@ -32,7 +32,7 @@ my ($quiet, $binary, $ignore_errors, $download); sub print_version { print < 1 } ( "albumart", "readpicture" ); sub mpd_exec { my $downloadseq; - # special case for "albumart"; if no offset is specified - # (invalid command) we synthesize a sequence of albumart + # special case for "albumart" and "readpicture"; if no offset is + # specified (invalid command) we synthesize a sequence of albumart # commands to retrieve the entire file. - if ($download && $_[0] eq "albumart" && @_ == 2) { + if ($download && $downloadcmds{$_[0]} && @_ == 2) { $_[2] = 0; $downloadseq = 2; } -- 2.43.0