db/simple: pass DatabaseSelection to WalkMount()
This passes the new `sort` and `window` attributes to the mounted database.
This commit is contained in:
parent
a73176a1e9
commit
94694e0f33
@ -27,6 +27,7 @@
|
||||
#include "db/Uri.hxx"
|
||||
#include "db/DatabaseLock.hxx"
|
||||
#include "db/Interface.hxx"
|
||||
#include "db/Selection.hxx"
|
||||
#include "song/Filter.hxx"
|
||||
#include "lib/icu/Collate.hxx"
|
||||
#include "fs/Traits.hxx"
|
||||
@ -227,7 +228,7 @@ Directory::Walk(bool recursive, const SongFilter *filter,
|
||||
call will lock it again */
|
||||
const ScopeDatabaseUnlock unlock;
|
||||
WalkMount(GetPath(), *mounted_database,
|
||||
"", recursive, filter,
|
||||
"", DatabaseSelection("", recursive, filter),
|
||||
visit_directory, visit_song,
|
||||
visit_playlist);
|
||||
return;
|
||||
|
@ -66,7 +66,8 @@ PrefixVisitPlaylist(const char *base, const VisitPlaylist &visit_playlist,
|
||||
|
||||
void
|
||||
WalkMount(const char *base, const Database &db,
|
||||
const char* uri, bool recursive, const SongFilter *filter,
|
||||
const char *uri,
|
||||
const DatabaseSelection &old_selection,
|
||||
const VisitDirectory &visit_directory, const VisitSong &visit_song,
|
||||
const VisitPlaylist &visit_playlist)
|
||||
{
|
||||
@ -87,16 +88,19 @@ WalkMount(const char *base, const Database &db,
|
||||
vp = std::bind(PrefixVisitPlaylist,
|
||||
base, std::ref(visit_playlist), _1, _2);
|
||||
|
||||
DatabaseSelection selection(old_selection);
|
||||
selection.uri = uri;
|
||||
|
||||
SongFilter prefix_filter;
|
||||
|
||||
if (base != nullptr && filter != nullptr) {
|
||||
if (base != nullptr && selection.filter != nullptr) {
|
||||
/* if the SongFilter contains a LOCATE_TAG_BASE_TYPE
|
||||
item, copy the SongFilter and drop the mount point
|
||||
from the filter, because the mounted database
|
||||
doesn't know its own location within MPD's VFS */
|
||||
prefix_filter = filter->WithoutBasePrefix(base);
|
||||
filter = &prefix_filter;
|
||||
prefix_filter = selection.filter->WithoutBasePrefix(base);
|
||||
selection.filter = &prefix_filter;
|
||||
}
|
||||
|
||||
db.Visit(DatabaseSelection(uri, recursive, filter), vd, vs, vp);
|
||||
db.Visit(selection, vd, vs, vp);
|
||||
}
|
||||
|
@ -23,11 +23,12 @@
|
||||
#include "db/Visitor.hxx"
|
||||
|
||||
class Database;
|
||||
class SongFilter;
|
||||
struct DatabaseSelection;
|
||||
|
||||
void
|
||||
WalkMount(const char *base, const Database &db,
|
||||
const char* uri, bool recursive, const SongFilter *filter,
|
||||
const char *uri,
|
||||
const DatabaseSelection &old_selection,
|
||||
const VisitDirectory &visit_directory, const VisitSong &visit_song,
|
||||
const VisitPlaylist &visit_playlist);
|
||||
|
||||
|
@ -280,8 +280,8 @@ SimpleDatabase::Visit(const DatabaseSelection &selection,
|
||||
protect.unlock();
|
||||
|
||||
WalkMount(r.directory->GetPath(), *(r.directory->mounted_database),
|
||||
(r.uri == nullptr)?"":r.uri, selection.recursive, selection.filter,
|
||||
visit_directory, visit_song, visit_playlist);
|
||||
(r.uri == nullptr)?"":r.uri, selection,
|
||||
visit_directory, visit_song, visit_playlist);
|
||||
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user