db/simple: add option to hide CUE target songs

This reduces duplicates in the music database by hiding the original
song file when it is referenced by a CUE sheet.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1275
This commit is contained in:
Max Kellermann
2021-10-14 13:03:54 +02:00
parent f7622ca332
commit 37bd6de658
9 changed files with 47 additions and 12 deletions

View File

@@ -60,6 +60,7 @@ inline SimpleDatabase::SimpleDatabase(const ConfigBlock &block)
#ifdef ENABLE_ZLIB
compress(block.GetBlockValue("compress", true)),
#endif
hide_playlist_targets(block.GetBlockValue("hide_playlist_targets", true)),
cache_path(block.GetPath("cache_directory"))
{
if (path.IsNull())
@@ -306,6 +307,7 @@ SimpleDatabase::Visit(const DatabaseSelection &selection,
visit_directory(r.directory->Export());
r.directory->Walk(selection.recursive, selection.filter,
hide_playlist_targets,
visit_directory, visit_song,
visit_playlist);
helper.Commit();