Commit 22ebb2bd authored by Max Kellermann's avatar Max Kellermann

db/proxy: send "window" as separate parameter to SendConstraints()

parent e1085680
...@@ -372,7 +372,8 @@ SendConstraints(mpd_connection *connection, const SongFilter &filter) ...@@ -372,7 +372,8 @@ SendConstraints(mpd_connection *connection, const SongFilter &filter)
} }
static bool static bool
SendConstraints(mpd_connection *connection, const DatabaseSelection &selection) SendConstraints(mpd_connection *connection, const DatabaseSelection &selection,
const RangeArg &window)
{ {
if (!selection.uri.empty() && if (!selection.uri.empty() &&
!mpd_search_add_base_constraint(connection, !mpd_search_add_base_constraint(connection,
...@@ -406,9 +407,8 @@ SendConstraints(mpd_connection *connection, const DatabaseSelection &selection) ...@@ -406,9 +407,8 @@ SendConstraints(mpd_connection *connection, const DatabaseSelection &selection)
#endif #endif
} }
if (selection.window != RangeArg::All() && if (window != RangeArg::All() &&
!mpd_search_add_window(connection, selection.window.start, !mpd_search_add_window(connection, window.start, window.end))
selection.window.end))
return false; return false;
return true; return true;
...@@ -826,7 +826,7 @@ try { ...@@ -826,7 +826,7 @@ try {
!selection.filter->HasFoldCase(); !selection.filter->HasFoldCase();
if (!mpd_search_db_songs(connection, exact) || if (!mpd_search_db_songs(connection, exact) ||
!SendConstraints(connection, selection) || !SendConstraints(connection, selection, selection.window) ||
!mpd_search_commit(connection)) !mpd_search_commit(connection))
ThrowError(connection); ThrowError(connection);
...@@ -994,7 +994,7 @@ try { ...@@ -994,7 +994,7 @@ try {
group.pop_back(); group.pop_back();
if (!mpd_search_db_tags(connection, tag_type2) || if (!mpd_search_db_tags(connection, tag_type2) ||
!SendConstraints(connection, selection) || !SendConstraints(connection, selection, selection.window) ||
!SendGroup(connection, group)) !SendGroup(connection, group))
ThrowError(connection); ThrowError(connection);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment