Modifications to db.c to enable the DAAP server to determine when
the media library has changed, and notify clients via an update.
Updates should show up to clients within 10 seconds.
Tested on iTunes 9.2.1
httpd_daap now responds to client "update" requests. Previously,
these requests were queued without response, and the client
closed the control session after 30 minutes of inactivity. This
modification pushes out an update response when a new database
revision becomes available, or 25 minutes, whichever comes sooner.
This change set does not monitor the database state, so dynamic
updates to a library listing do not occur. What you see at login
to the server is what you get.
Tested against iTunes 9.2.1; a connection stays up for hours,
regardless whether a song is being played or not.
In some complex ALSA setups, using PCM or Master is not the right thing
to do, so allow a custom mixer element name to be specified in the config
file for this use case.
Request and initial patch by Kurt Vanderlinden <kurt.vanderlinden@skynet.be>.
Pointed out by Raivo Hool; since we don't have a choice of performing or
not performing the metadata conversion, we will get "disc/totaldisc" for
ID3 files.
This happens under database load with many concurrent threads doing updates;
queries failing with SQLITE_SCHEMA at step time need to retried from scratch
until they succeeded or hit a best-effort limit of 5 retries.
The byte-order marks are useless for UTF-8, but that doesn't mean we don't
find them in the wild. Get rid of them, they confuse the hell out of the
collation functions.
Reported by Kai Elwert.
Handling of the sort tags was left into httpd_daap.c where the code runs
after the song is added to the songlist - effectively adding the sort tags
to the *next* song, leading to incorrect sort tags on the current song.