From 74c7e6ceda8d1cea7921b3102efdf32ea1ec161d Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Mon, 21 Oct 2013 22:54:45 +0200 Subject: [PATCH] Add support for daap.songuserplaycount It's used to give proper replies to Remote when it asks for unplayed Podcasts. Maps to play_count in the database, which already existed (very good forward thinking by the original authors). --- src/daap_query.gperf | 1 + src/dmap_fields.gperf | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/daap_query.gperf b/src/daap_query.gperf index 92d08918..fb61d635 100644 --- a/src/daap_query.gperf +++ b/src/daap_query.gperf @@ -35,6 +35,7 @@ struct dmap_query_field_map; "daap.songtime", "f.song_length", 1 "daap.songtrackcount", "f.total_tracks", 1 "daap.songtracknumber", "f.track", 1 +"daap.songuserplaycount", "f.play_count", 1 "daap.songyear", "f.year", 1 "com.apple.itunes.mediakind", "f.media_kind", 1 "com.apple.itunes.extended-media-kind", "f.media_kind", 1 diff --git a/src/dmap_fields.gperf b/src/dmap_fields.gperf index 999c9ffb..61e95412 100644 --- a/src/dmap_fields.gperf +++ b/src/dmap_fields.gperf @@ -79,6 +79,7 @@ static const struct dmap_field_map dfm_dmap_aseq = { -1, static const struct dmap_field_map dfm_dmap_asfm = { dbmfi_offsetof(type), -1, -1 }; static const struct dmap_field_map dfm_dmap_asgn = { dbmfi_offsetof(genre), -1, -1 }; static const struct dmap_field_map dfm_dmap_asdt = { dbmfi_offsetof(description), -1, -1 }; +static const struct dmap_field_map dfm_dmap_aspc = { dbmfi_offsetof(play_count), -1, -1 }; static const struct dmap_field_map dfm_dmap_asrv = { -1, -1, -1 }; static const struct dmap_field_map dfm_dmap_assr = { dbmfi_offsetof(samplerate), -1, -1 }; static const struct dmap_field_map dfm_dmap_assz = { dbmfi_offsetof(file_size), -1, -1 }; @@ -198,6 +199,7 @@ struct dmap_field; "daap.songgenre", "asgn", &dfm_dmap_asgn, DMAP_TYPE_STRING "daap.songkeywords", "asky", &dfm_dmap_asky, DMAP_TYPE_STRING "daap.songlongcontentdescription", "aslc", &dfm_dmap_aslc, DMAP_TYPE_STRING +"daap.songuserplaycount", "aspc", &dfm_dmap_aspc, DMAP_TYPE_UINT "daap.songrelativevolume", "asrv", &dfm_dmap_asrv, DMAP_TYPE_BYTE "daap.sortartist", "assa", &dfm_dmap_assa, DMAP_TYPE_STRING "daap.sortcomposer", "assc", &dfm_dmap_assc, DMAP_TYPE_STRING