diff options
author | Max Kellermann <max@musicpd.org> | 2020-04-03 17:06:25 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2020-04-03 17:07:15 +0200 |
commit | 6c8eb3c7ed89d0d174ca2fceaf8bfdc4dcd513b6 (patch) | |
tree | cde9511ad56f87e912a89bbd9db05a08dcec2b6b /src/db/plugins/simple | |
parent | 870151214d4a1e0fff5b4a7537a0ae070dac30a5 (diff) |
db/simple/Directory: rename LookupResult::uri to "rest"
Diffstat (limited to 'src/db/plugins/simple')
-rw-r--r-- | src/db/plugins/simple/Directory.hxx | 2 | ||||
-rw-r--r-- | src/db/plugins/simple/SimpleDatabasePlugin.cxx | 24 |
2 files changed, 13 insertions, 13 deletions
diff --git a/src/db/plugins/simple/Directory.hxx b/src/db/plugins/simple/Directory.hxx index a3533807a..cc3003fc2 100644 --- a/src/db/plugins/simple/Directory.hxx +++ b/src/db/plugins/simple/Directory.hxx @@ -186,7 +186,7 @@ public: * The remaining URI part (without leading slash) or * nullptr if the given URI was consumed completely. */ - const char *uri; + const char *rest; }; /** diff --git a/src/db/plugins/simple/SimpleDatabasePlugin.cxx b/src/db/plugins/simple/SimpleDatabasePlugin.cxx index d0bae6c0c..9df3ca066 100644 --- a/src/db/plugins/simple/SimpleDatabasePlugin.cxx +++ b/src/db/plugins/simple/SimpleDatabasePlugin.cxx @@ -212,7 +212,7 @@ SimpleDatabase::GetSong(const char *uri) const protect.unlock(); const LightSong *song = - r.directory->mounted_database->GetSong(r.uri); + r.directory->mounted_database->GetSong(r.rest); if (song == nullptr) return nullptr; @@ -222,17 +222,17 @@ SimpleDatabase::GetSong(const char *uri) const return prefixed_light_song; } - if (r.uri == nullptr) + if (r.rest == nullptr) /* it's a directory */ throw DatabaseError(DatabaseErrorCode::NOT_FOUND, "No such song"); - if (strchr(r.uri, '/') != nullptr) + if (strchr(r.rest, '/') != nullptr) /* refers to a URI "below" the actual song */ throw DatabaseError(DatabaseErrorCode::NOT_FOUND, "No such song"); - const Song *song = r.directory->FindSong(r.uri); + const Song *song = r.directory->FindSong(r.rest); protect.unlock(); if (song == nullptr) throw DatabaseError(DatabaseErrorCode::NOT_FOUND, @@ -290,7 +290,7 @@ SimpleDatabase::Visit(const DatabaseSelection &selection, protect.unlock(); WalkMount(r.directory->GetPath(), *(r.directory->mounted_database), - (r.uri == nullptr)?"":r.uri, selection, + (r.rest == nullptr)?"":r.rest, selection, visit_directory, visit_song, visit_playlist); return; @@ -298,7 +298,7 @@ SimpleDatabase::Visit(const DatabaseSelection &selection, DatabaseVisitorHelper helper(CheckSelection(selection), visit_song); - if (r.uri == nullptr) { + if (r.rest == nullptr) { /* it's a directory */ if (selection.recursive && visit_directory) @@ -311,9 +311,9 @@ SimpleDatabase::Visit(const DatabaseSelection &selection, return; } - if (strchr(r.uri, '/') == nullptr) { + if (strchr(r.rest, '/') == nullptr) { if (visit_song) { - Song *song = r.directory->FindSong(r.uri); + Song *song = r.directory->FindSong(r.rest); if (song != nullptr) { const LightSong song2 = song->Export(); if (selection.Match(song2)) @@ -402,15 +402,15 @@ SimpleDatabase::Mount(const char *uri, DatabasePtr db) ScopeDatabaseLock protect; auto r = root->LookupDirectory(uri); - if (r.uri == nullptr) + if (r.rest == nullptr) throw DatabaseError(DatabaseErrorCode::CONFLICT, "Already exists"); - if (strchr(r.uri, '/') != nullptr) + if (strchr(r.rest, '/') != nullptr) throw DatabaseError(DatabaseErrorCode::NOT_FOUND, "Parent not found"); - Directory *mnt = r.directory->CreateChild(r.uri); + Directory *mnt = r.directory->CreateChild(r.rest); mnt->mounted_database = std::move(db); } @@ -461,7 +461,7 @@ SimpleDatabase::LockUmountSteal(const char *uri) noexcept ScopeDatabaseLock protect; auto r = root->LookupDirectory(uri); - if (r.uri != nullptr || !r.directory->IsMount()) + if (r.rest != nullptr || !r.directory->IsMount()) return nullptr; auto db = std::move(r.directory->mounted_database); |