Commit 4d5ebafa authored by Max Kellermann's avatar Max Kellermann

Main: check the music directory

Move call from Mapper.cxx.
parent ec8873b1
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#include "fs/AllocatedPath.hxx" #include "fs/AllocatedPath.hxx"
#include "fs/Config.hxx" #include "fs/Config.hxx"
#include "fs/StandardDirectory.hxx" #include "fs/StandardDirectory.hxx"
#include "fs/CheckFile.hxx"
#include "playlist/PlaylistRegistry.hxx" #include "playlist/PlaylistRegistry.hxx"
#include "zeroconf/ZeroconfGlue.hxx" #include "zeroconf/ZeroconfGlue.hxx"
#include "decoder/DecoderList.hxx" #include "decoder/DecoderList.hxx"
...@@ -145,8 +146,10 @@ glue_mapper_init(Error &error) ...@@ -145,8 +146,10 @@ glue_mapper_init(Error &error)
if (music_dir.IsNull()) if (music_dir.IsNull())
music_dir = GetUserMusicDir(); music_dir = GetUserMusicDir();
if (!music_dir.IsNull()) if (!music_dir.IsNull()) {
music_dir.ChopSeparators(); music_dir.ChopSeparators();
CheckDirectoryReadable(music_dir);
}
#ifdef ENABLE_DATABASE #ifdef ENABLE_DATABASE
if (!music_dir.IsNull()) { if (!music_dir.IsNull()) {
......
...@@ -54,8 +54,6 @@ mapper_set_music_dir(AllocatedPath &&path) ...@@ -54,8 +54,6 @@ mapper_set_music_dir(AllocatedPath &&path)
assert(!path.IsNull()); assert(!path.IsNull());
music_dir_fs = std::move(path); music_dir_fs = std::move(path);
CheckDirectoryReadable(music_dir_fs);
} }
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment