I found kionjb was not suitable for uploading many files in
one go as the rapid disconnection and reconnection to the
player between tracks often caused it to get stuck while
connecting. Reading the libnjb FAQ confirms that such
rapid connections won't work. This patch attempts to fix
this by only disconnecting from the player after the
connection has been idle for a period (currently 5s, but
should probably be only 1 or 2 seconds).
It uses the "special" slot in the kio slave which can be
called after a given timeout. Every time connect() is
called, the timer is disabled. When disconnect is called
(with force=false), the timer is set for 5s, but the player
remains connected. It is only disconnected after the
timeout has elapsed or when the kioslave is destroyed.
I've been able to load several hundred megabytes of mp3s
in one go with this patch applied, with no errors.
The patch should be applied to the current CVS after
applying my build fix patch.