From da29fa5f93a706a926d8d245d5a5d04b0898503e Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Tue, 4 Feb 2020 20:45:28 +0100 Subject: [PATCH] [scan] Make sure new, nested playlists are scanned During scanning we might find a new, nested playlist (so inside another m3u), which we will then save. When the scanner then reaches the actual playlist file, we must make sure to scan the contents of it. This means the timestamp when saving the first time has to be set to a dummy value. --- src/library/filescanner_playlist.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/library/filescanner_playlist.c b/src/library/filescanner_playlist.c index cd79b85d..e3eb6644 100644 --- a/src/library/filescanner_playlist.c +++ b/src/library/filescanner_playlist.c @@ -177,7 +177,7 @@ process_nested_playlist(int parent_id, const char *path) goto error; pli->type = PL_FOLDER; - ret = db_pl_update(pli); + ret = library_playlist_save(pli); if (ret < 0) goto error; @@ -191,6 +191,13 @@ process_nested_playlist(int parent_id, const char *path) ret = playlist_fill(pli, path); if (ret < 0) goto error; + + // This is a "trick" to make sure the nested playlist will be scanned. + // Otherwise what could happen is that we save the playlist with current + // db_timestamp, and when the scanner finds the actual playlist it will + // conclude from the timestamp that the playlist is unchanged, and thus + // it would never be scanned. + pli->db_timestamp = 1; } pli->parent_id = parent_id;