db/simple/Directory: eliminate method LookupSong()

Move to SimpleDatabase::GetSong() to give that method more control.
This commit is contained in:
Max Kellermann
2014-02-26 20:10:31 +01:00
parent 69a42fc901
commit 21e19ef69f
3 changed files with 19 additions and 30 deletions

View File

@@ -202,24 +202,6 @@ Directory::FindSong(const char *name_utf8) const
return nullptr;
}
Song *
Directory::LookupSong(const char *uri)
{
assert(holding_db_lock());
assert(uri != nullptr);
auto r = LookupDirectory(uri);
if (r.uri == nullptr)
/* it's a directory */
return nullptr;
if (strchr(r.uri, '/') != nullptr)
/* refers to a URI "below" the actual song */
return nullptr;
return r.directory->FindSong(r.uri);
}
static int
directory_cmp(gcc_unused void *priv,
struct list_head *_a, struct list_head *_b)