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


No differences found