aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist
diff options
context:
space:
mode:
Diffstat (limited to 'src/playlist')
-rw-r--r--src/playlist/PlaylistMapper.cxx6
-rw-r--r--src/playlist/PlaylistSong.cxx4
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
}
}