From: Nick Bowler Date: Sun, 25 Jul 2021 16:58:18 +0000 (-0400) Subject: mpdexec: Add support for readpicture command in download mode. X-Git-Url: https://git.draconx.ca/gitweb/mpdhacks.git/commitdiff_plain/298442ad553cc0309818e7a435b1e349bc077d47 mpdexec: Add support for readpicture command in download mode. --- 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; }