From 0d4dd06b51cde3587e76877f022e03fc5a93f9d4 Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Mon, 25 Jun 2018 20:03:38 +0200 Subject: [PATCH] [filescanner] iTunes XML mapping of Play Count and Play Date See issue #549 --- src/library/filescanner_itunes.c | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/library/filescanner_itunes.c b/src/library/filescanner_itunes.c index e58b8f78..e270d785 100644 --- a/src/library/filescanner_itunes.c +++ b/src/library/filescanner_itunes.c @@ -66,6 +66,45 @@ struct metadata_map { size_t offset; }; +/* Example iTunes XML dict + * TODO Skip Count and Skip Date + * + + Track ID615 + Size7602660 + Total Time317178 + Track Number4 + Year1975 + BPM122 + Date Modified2016-08-09T15:07:35Z + Date Added2009-03-27T15:37:39Z + Bit Rate192 + Sample Rate44100 + Volume Adjustment255 + Play Count94 + Play Date3598042339 + Play Date UTC2018-01-06T05:12:19Z + Skip Count17 + Skip Date2018-02-28T22:17:40Z + Rating80 + Album Rating60 + Persistent ID735C22B6342B6B74 + Track TypeFile + File Folder Count-1 + Library Folder Count-1 + NameWish You Were Here + ArtistPink Floyd + Album ArtistPink Floyd + ComposerDavid Gilmour/Roger Waters + AlbumWish You Were Here + GenreClassic Rock + KindMPEG audio file + Equalizer#!#116#!# + EqualizerRock + Sort AlbumWish You Were Here + Locationfile://localhost/E:/Music/Pink%20Floyd/Wish%20You%20Were%20Here/04%20Wish%20You%20Were%20Here.mp3 + + */ static struct metadata_map md_map[] = { { "Name", PLIST_STRING, mfi_offsetof(title) }, @@ -87,6 +126,8 @@ static struct metadata_map md_map[] = { "Rating", PLIST_UINT, mfi_offsetof(rating) }, { "Compilation", PLIST_BOOLEAN, mfi_offsetof(compilation) }, { "Date Added", PLIST_DATE, mfi_offsetof(time_added) }, + { "Play Date", PLIST_UINT, mfi_offsetof(time_played) }, + { "Play Count", PLIST_UINT, mfi_offsetof(play_count) }, { NULL, 0, 0 } };