From 6eaf47a8d6d65f8994d8d61986b59233a6b8b8b7 Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Fri, 18 Oct 2013 23:07:40 +0200 Subject: [PATCH] Show items with genre=Podcast as Podcast items in Remote - also add Podcast smart playlist to default playlists --- src/db.c | 6 +++++- src/filescanner_ffmpeg.c | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/db.c b/src/db.c index 8a36a48e..99c414d0 100644 --- a/src/db.c +++ b/src/db.c @@ -4122,9 +4122,12 @@ db_perthread_deinit(void) "INSERT INTO playlists (id, title, type, query, db_timestamp, path, idx, special_id)" \ " VALUES(4, 'TV Shows', 1, 'f.media_kind = 64', 0, '', 0, 5);" +#define Q_PL5 \ + "INSERT INTO playlists (id, title, type, query, db_timestamp, path, idx, special_id)" \ + " VALUES(5, 'Podcasts', 1, 'f.media_kind = 4', 0, '', 0, 1);" + /* These are the remaining automatically-created iTunes playlists, but * their query is unknown - " VALUES(5, 'Podcasts', 0, 'media_kind = 128 ', 0, '', 0, 1);" " VALUES(6, 'iTunes U', 0, 'media_kind = 256', 0, '', 0, 13);" " VALUES(7, 'Audiobooks', 0, 'media_kind = 512', 0, '', 0, 7);" " VALUES(8, 'Purchased', 0, 'media_kind = 1024', 0, '', 0, 8);" @@ -4177,6 +4180,7 @@ static const struct db_init_query db_init_queries[] = { Q_PL2, "create default smart playlist 'Music'" }, { Q_PL3, "create default smart playlist 'Movies'" }, { Q_PL4, "create default smart playlist 'TV Shows'" }, + { Q_PL5, "create default smart playlist 'Podcasts'" }, { Q_SCVER, "set schema version" }, }; diff --git a/src/filescanner_ffmpeg.c b/src/filescanner_ffmpeg.c index 668eefb6..3b58db1c 100644 --- a/src/filescanner_ffmpeg.c +++ b/src/filescanner_ffmpeg.c @@ -616,6 +616,11 @@ scan_metadata_ffmpeg(char *file, struct media_file_info *mfi) { mfi->media_kind = 2; } + /* Podcasts are either media_kind 4, 6 or 7 - unsure what the difference is */ + else if (strcmp(mfi->genre,"Podcast") == 0) + { + mfi->media_kind = 4; + } skip_extract: if (mdcount == 0)