]> git.draconx.ca Git - mpdhacks.git/commitdiff
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)
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).


No differences found