Commit Graph

70 Commits

Author SHA1 Message Date
Julien BLACHE ece7c0d071 Handle DAAP extra_data requests for groups/items artwork 2010-03-07 15:45:52 +01:00
Julien BLACHE 641e5462cc Rename pl_id member of struct query_params 2010-03-07 15:23:40 +01:00
Julien BLACHE 224ef48137 Make album groups persistent
Store groups (only album groups supported at the moment) in the DB,
so their ids are persistent for the duration of the forked-daapd session.

Those ids are used to, among other things, retrieve artwork, so we must
provide ourselves some persistence here.

This brings us to schema version 8.
2010-03-06 19:02:49 +01:00
Julien BLACHE 748cca63be Maintain songalbumid inside the files table
songalbumid is used a lot in queries from Remote; computing the hash for
each row is a major waste of time on big libraries and slow machines, so
let's store the hash in the table.

This brings us to schema version 7.
2010-03-06 17:29:37 +01:00
Julien BLACHE 20c57d5289 Implement DAAP auto-logout
And advertise it.
2010-03-06 10:30:59 +01:00
Julien BLACHE 8c2def5ef5 Move daap_session_kill() higher up
No functional changes.
2010-03-06 10:29:53 +01:00
Julien BLACHE 18abda3a97 Use evhttp_connection's closecb instead of our fail_cb extension
The closecb callback of evhttp_connection does what we need, so no need
to use that extension anymore.
2010-02-14 09:34:29 +01:00
Ace Jones a92dc076e8 Add a test facility for DMAP
Add a /dmap-test handler that sends back a list containing test values
for all standard DMAP types (string + all integer types).
2010-02-10 18:29:26 +01:00
Julien BLACHE 056f4b6997 Reindent dmap_add_field()
Fix indentation in dmap_add_field(), no functional changes.
2010-02-10 18:29:26 +01:00
Julien BLACHE 3280fd5cf9 Get rid of magic hash values for filtering query parameters
Some metadata were filtered out from the reply by directly checking
for their hash, including the hash value in the code. Remove the magic
values and compare dfm->field against the relevant dmap_* field as for
other special cases.
2010-02-10 18:29:26 +01:00
Julien BLACHE 2524eb0f8f Rework special cases in daap_reply_songlist_generic()
Use a pointer comparison instead of strcmp(), now that the fields
have been separated out from the field map.
2010-02-10 18:29:26 +01:00
Julien BLACHE 3df34fe9a8 Remove mper special case in daap_reply_groups()
mper was so far the only LONG we really cared about, but dmap_add_field()
now has proper support all DMAP types. This special case can go.
2010-02-10 18:29:26 +01:00
Ace Jones cfabc9a456 Update DMAP fields
Update field types, add new fields (commented out). This fixes a number
of mis-assigned types. Update generated from the result of a /content-codes
request.
2010-02-10 18:29:26 +01:00
Ace Jones b4b89dd937 Break out the dmap_field_map struct into two structs
Introduce struct dmap_field holding the field tag, description and
DMAP type and use it in struct dmap_field_map to replace the tag,
desc and type fields.

This enables semi-automated updates of the DMAP fields information
from the output of a /content-codes request.
2010-02-10 18:29:20 +01:00
Julien BLACHE d8bd8e5381 Rewrite dmap_add_field() to handle properly all DMAP types 2010-02-10 18:21:32 +01:00
Ace Jones 0607e82a42 Add missing DMAP types and correct existing types
Most of the unsigned DMAP types were missing and assignments were incorrect
between signed and unsigned types. Fix all of this, and add (preliminary)
support for the new types.
2010-02-10 18:21:32 +01:00
Julien BLACHE d4fb2091c8 Use an enum for DMAP types 2010-02-10 18:21:32 +01:00
Julien BLACHE 42dd7ddd00 Kill code redundant with dmap_add_field()
This code in daap_reply_songlist_generic() is redundant with code
in (new) dmap_add_field() and can be removed, with a tweak: we must
ensure the val integer is always 0 if not used to override a value in
the transcoding case.
2010-02-10 18:21:32 +01:00
Julien BLACHE 1a3620d0a4 Handle DMAP long type properly in dmap_add_field() 2010-02-02 21:09:56 +01:00
Julien BLACHE 58faeaceca Integer types cleanup
Try to be a bit more strict about integer types, use off_t or int64_t for
file size and file offsets.

Replace safe_ato*() by safe_atoi32() and safe_atoi64(), fix integer types
at call sites to match.
2010-02-02 21:09:56 +01:00
Julien BLACHE 168144c1e0 Make daap_session_find() non-static so DACP can use it 2010-01-30 17:30:22 +01:00
Julien BLACHE 44bf308701 Waive HTTP authentication on the library for Remote
DAAP queries from Remote won't need HTTP authentication as they all
require a valid session-id; Remote can only obtain a valid session-id
if its pairing-guid is known to us (it did pair successfully with us).
2010-01-30 17:30:22 +01:00
Julien BLACHE e016ced119 Authenticate Remote clients by their pairing-guid
Remote clients have a waiver for HTTP authentication; they are authenticated
by their pairing-guid given during the pairing process.
2010-01-30 17:30:22 +01:00
Julien BLACHE 07a71b4e94 Reorganize httpd_daap
Some code moved around for clarity, no functional changes.
2010-01-30 17:30:22 +01:00
Julien BLACHE 7ec27a30eb Use DMAP routines from dmap_helpers.c 2010-01-30 17:30:22 +01:00
Julien BLACHE 29fb23893d DAAP update request requires a session-id 2010-01-30 17:30:21 +01:00
Julien BLACHE b9a2e10272 Modify DAAP update request debug messages 2010-01-30 17:30:21 +01:00
Julien BLACHE 78275ae432 Remove useless include 2010-01-30 17:30:21 +01:00
Julien BLACHE 42f39938d5 Start implementing DAAP updates
Stall update requests if revision-number == current revision. This is a
first step that is necessary to get clients to work properly (eg Remote).
2010-01-28 19:20:00 +01:00
Julien BLACHE b5b9f92d97 Fix HTTP error return in daap_session_find() 2010-01-27 12:18:22 +01:00
Julien BLACHE 98cb978b9b Set capability atoms to true in server-info reply
Capability atoms like mslr, msbr and friends should be set to true; it
seems their presence in the reply is actually enough, though.
2010-01-25 18:33:25 +01:00
Julien BLACHE 022bebe1d9 Send back mslr in server-info reply, indicating login is required
At least FrontRow honours this atom of the server-info reply.
2010-01-24 10:53:49 +01:00
Julien BLACHE d3fe586d5b Remove a special case for playlist #1
Not needed anymore, now that playlist #1 has been turned into a smart
playlist.
2010-01-22 19:02:29 +01:00
Ace Jones 1af1cf51c7 Return special playlists in playlist list response 2010-01-21 17:56:44 +01:00
Julien BLACHE 87abc3f432 Avoid useless double attempt at converting string to integer
Fixup dmap_add_field() and one of its callers to avoid making two useless
attempts at converting a string to an integer in some cases.
2010-01-20 18:34:36 +01:00
Julien BLACHE ba251b16ae Start keeping track of DAAP sessions
This will soon be required as we'll need to keep some knowledge about
the session in some cases. This also makes us a bit more compliant.
2010-01-20 18:24:52 +01:00
Ace Jones d96cdd7400 Add DAAP request handler for databases/###/groups (albums)
As of now we only support album groups, but there may be more than
album groups.
2010-01-10 14:43:23 +01:00
Ace Jones e033d35195 Rework error handling in daap_reply_playlists()
Kill a bit of code duplication in the error handling.
2010-01-10 14:43:22 +01:00
Ace Jones ac82b176a0 Rework error handling in daap_reply_songlist_generic()
Kill a bit of code duplication in the error handling.
2010-01-10 14:43:22 +01:00
Ace Jones cac2c032f6 Add the daap.songalbumartist DMAP field 2010-01-10 12:11:00 +01:00
Julien BLACHE 974a74a833 Update copyright notices for 2010 2010-01-05 19:34:00 +01:00
Ace Jones d3350713d1 Return daap.songalbumid as a hash of the album_artist + album
iPhone remote will later want to query by album. Instead of doing a
fulltext query, it uses a 64-bit hash of the album + album_artist. It
is not necessary to use the same hash algorithm that iTunes uses. The
important thing is that we can later respond to a query=('daap.songalbumid:xxx')
with this value.
2010-01-04 18:00:05 +01:00
Ace Jones 117ee15e44 Add handler for DMAP extra_data requests
iPhone Remote uses the following requests to get cover art for
songs and albums:

/databases/#/items/#/extra_data/artwork
/databases/#/groups/#/extra_data/artwork

For now, we will return the valid and correct response that we
have "No content".  In the future, the real artwork could be
extracted and returned here.
2010-01-03 18:55:32 +01:00
Ace Jones abbba5cf47 Fix typo in DAAP error message 2009-12-30 18:47:41 +01:00
Ace Jones 76fc069f22 Fix missing argument to debug call 2009-12-30 18:46:41 +01:00
Julien BLACHE 403153f64b Reindent the dmap_fields table, no code changes 2009-12-26 09:28:28 +01:00
Ace Jones 000e13b7ee Return TV metadata in DMAP response 2009-12-26 09:23:13 +01:00
Ace Jones d231faff2d Handle DAAP activity request
Reply to the DAAP /activity request with 204 / No content. Used by iTunes to
ping the server while streaming.
2009-12-20 14:43:28 +01:00
Julien BLACHE b9e7df5be3 Return a proper Content-Type when streaming videos
Clients like Front Row expect video/<type> for video streaming, whereas iTunes
likes application/x-dmap-tagged when streaming audio.

Based on a patch by Ace Jones <ace.jones1@yahoo.com>.
2009-12-08 21:04:30 +01:00
Julien BLACHE 946758cec7 Rework iTunes 9 absolute request uri fix 2009-11-14 11:23:03 +01:00