]> git.draconx.ca Git - mpdhacks.git/commit
mpdreload: Handle playlist load errors better.
authorNick Bowler <nbowler@draconx.ca>
Tue, 5 Jan 2021 03:24:24 +0000 (22:24 -0500)
committerNick Bowler <nbowler@draconx.ca>
Tue, 5 Jan 2021 03:32:33 +0000 (22:32 -0500)
commitb4bb20156a1c1c3d348a766216df738f0eae80e5
tree6d4e6ecbbdb2a81cb868ff86dd07d797893b9f18
parentf0e74c3a1fc44153fe80961ff7de3b4a0786e5ea
mpdreload: Handle playlist load errors better.

When using the "load" command to load tracks from a stored playlist,
there is no guarantee that MPD will actually successfully load them.
This can occur, for example, if a playlist is created and then some
of the files in it are removed from the database.

Such failures are not reported directly by the protocol.  The "load"
command will succeed but you just get less tracks added to the play
queue.  This gets mpdreload confused as it no longer has an accurate
picture of the exact queue positions.

Solve this by querying the new queue length after tracks are loaded
from the playlist.  This allows mpdreload to determine the number of
failures and adjust the expected positions accordingly.
mpdreload.pl