diff options
author | Max Kellermann <max@duempel.org> | 2014-01-30 20:29:48 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-01-30 20:39:40 +0100 |
commit | 4465e2c46bbed438377dc4a99df333bd5c058d5e (patch) | |
tree | cbc1d27aad939689f44b0ac3542a6ca1777b9dc1 /src/playlist | |
parent | 34b309b99aa2f274308f19974c428e1c7ac5d66f (diff) |
db: add compile-time option to disable database
Diffstat (limited to 'src/playlist')
-rw-r--r-- | src/playlist/PlaylistMapper.cxx | 6 | ||||
-rw-r--r-- | src/playlist/PlaylistSong.cxx | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/playlist/PlaylistMapper.cxx b/src/playlist/PlaylistMapper.cxx index 0df0bc61f..ec32abd32 100644 --- a/src/playlist/PlaylistMapper.cxx +++ b/src/playlist/PlaylistMapper.cxx @@ -64,6 +64,8 @@ playlist_open_in_playlist_dir(const char *uri, Mutex &mutex, Cond &cond, return playlist_open_path(path_fs.c_str(), mutex, cond, is_r); } +#ifdef ENABLE_DATABASE + /** * Load a playlist from the configured music directory. */ @@ -80,6 +82,8 @@ playlist_open_in_music_dir(const char *uri, Mutex &mutex, Cond &cond, return playlist_open_path(path.c_str(), mutex, cond, is_r); } +#endif + SongEnumerator * playlist_mapper_open(const char *uri, Mutex &mutex, Cond &cond, InputStream **is_r) @@ -91,12 +95,14 @@ playlist_mapper_open(const char *uri, Mutex &mutex, Cond &cond, return playlist; } +#ifdef ENABLE_DATABASE if (uri_safe_local(uri)) { auto playlist = playlist_open_in_music_dir(uri, mutex, cond, is_r); if (playlist != nullptr) return playlist; } +#endif return nullptr; } diff --git a/src/playlist/PlaylistSong.cxx b/src/playlist/PlaylistSong.cxx index 69f8762ab..b382994a6 100644 --- a/src/playlist/PlaylistSong.cxx +++ b/src/playlist/PlaylistSong.cxx @@ -79,6 +79,7 @@ playlist_check_load_song(DetachedSong &song) apply_song_metadata(song, tmp); return true; } else { +#ifdef ENABLE_DATABASE DetachedSong *tmp = DatabaseDetachSong(uri, IgnoreError()); if (tmp == nullptr) return false; @@ -86,6 +87,9 @@ playlist_check_load_song(DetachedSong &song) apply_song_metadata(song, *tmp); delete tmp; return true; +#else + return false; +#endif } } |