db/DatabasePlaylist: pass Database reference around

Reduce global variable usage, move to frontend code.
This commit is contained in:
Max Kellermann
2014-02-01 01:11:50 +01:00
parent db69ceade6
commit 29072797ca
9 changed files with 53 additions and 27 deletions

View File

@@ -92,11 +92,12 @@ SongLoader::LoadSong(const char *uri_utf8, Error &error) const
/* URI relative to the music directory */
#ifdef ENABLE_DATABASE
return DatabaseDetachSong(uri_utf8, error);
#else
if (db != nullptr)
return DatabaseDetachSong(*db, uri_utf8, error);
#endif
error.Set(playlist_domain, int(PlaylistResult::NO_SUCH_SONG),
"No database");
return nullptr;
#endif
}
}