db/update/Walk: load all .mpdignore files of all parent directories
When updating everything, this did work, but if updating only a subdirectory, the ".mpdignore" in the parents were not used. Closes https://github.com/MusicPlayerDaemon/MPD/issues/1172
This commit is contained in:
parent
db0682a469
commit
363d9f0180
2
NEWS
2
NEWS
@ -1,4 +1,6 @@
|
|||||||
ver 0.22.9 (not yet released)
|
ver 0.22.9 (not yet released)
|
||||||
|
* database
|
||||||
|
- simple: load all .mpdignore files of all parent directories
|
||||||
* Windows
|
* Windows
|
||||||
- fix build failure with SQLite
|
- fix build failure with SQLite
|
||||||
|
|
||||||
|
@ -458,6 +458,28 @@ UpdateWalk::DirectoryMakeUriParentChecked(Directory &root,
|
|||||||
return directory;
|
return directory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
LoadExcludeLists(std::forward_list<ExcludeList> &lists,
|
||||||
|
const Storage &storage, const Directory &directory) noexcept
|
||||||
|
{
|
||||||
|
assert(!lists.empty());
|
||||||
|
|
||||||
|
if (!directory.IsRoot())
|
||||||
|
LoadExcludeLists(lists, storage, *directory.parent);
|
||||||
|
|
||||||
|
lists.emplace_front();
|
||||||
|
LoadExcludeListOrLog(storage, directory, lists.front());
|
||||||
|
}
|
||||||
|
|
||||||
|
static auto
|
||||||
|
LoadExcludeLists(const Storage &storage, const Directory &directory) noexcept
|
||||||
|
{
|
||||||
|
std::forward_list<ExcludeList> lists;
|
||||||
|
lists.emplace_front();
|
||||||
|
LoadExcludeLists(lists, storage, directory);
|
||||||
|
return lists;
|
||||||
|
}
|
||||||
|
|
||||||
inline void
|
inline void
|
||||||
UpdateWalk::UpdateUri(Directory &root, const char *uri) noexcept
|
UpdateWalk::UpdateUri(Directory &root, const char *uri) noexcept
|
||||||
try {
|
try {
|
||||||
@ -478,9 +500,8 @@ try {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ExcludeList exclude_list;
|
const auto exclude_lists = LoadExcludeLists(storage, *parent);
|
||||||
|
UpdateDirectoryChild(*parent, exclude_lists.front(), name, info);
|
||||||
UpdateDirectoryChild(*parent, exclude_list, name, info);
|
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
LogError(std::current_exception());
|
LogError(std::current_exception());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user