From 3527113a9bbf6df101ccb66e639577c0df654c86 Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Sat, 4 Jun 2016 23:30:01 +0200 Subject: [PATCH] [filescanner] Option to import iTunes smart playlists --- forked-daapd.conf | 3 +++ src/conffile.c | 1 + src/filescanner_itunes.c | 6 +++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/forked-daapd.conf b/forked-daapd.conf index a80b9452..06c4ec33 100644 --- a/forked-daapd.conf +++ b/forked-daapd.conf @@ -134,6 +134,9 @@ library { # Should iTunes metadata override ours? # itunes_overrides = false + # Should we import the content of iTunes smart playlists? +# itunes_smartpl = false + # Decoding options for DAAP clients # Since iTunes has native support for mpeg, mp4a, mp4v, alac and wav, # such files will be sent as they are. Any other formats will be decoded diff --git a/src/conffile.c b/src/conffile.c index 0c26fc99..dbb8f5fb 100644 --- a/src/conffile.c +++ b/src/conffile.c @@ -85,6 +85,7 @@ static cfg_opt_t sec_library[] = CFG_STR_LIST("filepath_ignore", NULL, CFGF_NONE), CFG_BOOL("filescan_disable", cfg_false, CFGF_NONE), CFG_BOOL("itunes_overrides", cfg_false, CFGF_NONE), + CFG_BOOL("itunes_smartpl", cfg_false, CFGF_NONE), CFG_STR_LIST("no_decode", NULL, CFGF_NONE), CFG_STR_LIST("force_decode", NULL, CFGF_NONE), CFG_END() diff --git a/src/filescanner_itunes.c b/src/filescanner_itunes.c index 8005f532..6abd8420 100644 --- a/src/filescanner_itunes.c +++ b/src/filescanner_itunes.c @@ -668,9 +668,9 @@ ignore_pl(plist_t pl, char *name) /* Special (builtin) playlists */ get_dictval_int_from_key(pl, "Distinguished Kind", &kind); - /* If only we could recover the smart playlists ... */ - if (plist_dict_get_item(pl, "Smart Info") - || plist_dict_get_item(pl, "Smart Criteria")) + /* Import smart playlists (optional) */ + if (!cfg_getbool(cfg_getsec(cfg, "library"), "itunes_smartpl") + && (plist_dict_get_item(pl, "Smart Info") || plist_dict_get_item(pl, "Smart Criteria"))) smart = 1; /* Not interested in the Master playlist */