]> git.draconx.ca Git - mpdhacks.git/commit
mpdthumb: Fix compatibility with newer MPD versions.
authorNick Bowler <nbowler@draconx.ca>
Thu, 22 Jul 2021 03:46:50 +0000 (23:46 -0400)
committerNick Bowler <nbowler@draconx.ca>
Thu, 22 Jul 2021 04:10:40 +0000 (00:10 -0400)
commitb6a0cfc0340af1a0a712dd7dd67fb59418cdcb15
tree590b5215dc5a728f45c70538c2a9da0bf810770c
parentb4bb20156a1c1c3d348a766216df738f0eae80e5
mpdthumb: Fix compatibility with newer MPD versions.

It seems that recent MPD servers have made backward-incompatible changes
to the albumart command.

Specifically, the cache check currently sends an absurdly huge offset to
avoid downloading a pointless and unnecessary multi-KB blob for every
image it is querying.  While this worked well with older servers, new
servers now reject such commands with an error instead of returning
useful information.

Fortunately, newer servers also implement the "binarylimit" command to
reduce the amount of data transferred.  For some reason we can't ask the
server to send less than 64 bytes but whatever, it is probably good
enough.

So work around the problem by testing whether the server supports
binarylimit, and use the new method if it does.  Otherwise use the
old method.  Command-line options are provided to force the behaviour
one way or the other (which avoids the extra round trip to the server).
mpdthumb.sh