Added a sentinel when UI limit is hit + a message when nothing found, fixes #358
This commit is contained in:
@@ -182,7 +182,7 @@ namespace lms::db
|
||||
return utils::fetchQuerySingleResult(session.getDboSession()->query<Wt::Dbo::ptr<TrackList>>("select t_l from tracklist t_l").where("t_l.name = ?").bind(name).where("t_l.type = ?").bind(type).where("t_l.user_id = ?").bind(userId));
|
||||
}
|
||||
|
||||
RangeResults<TrackListId> TrackList::find(Session& session, const FindParameters& params)
|
||||
std::vector<TrackListId> TrackList::find(Session& session, const FindParameters& params)
|
||||
{
|
||||
session.checkReadTransaction();
|
||||
auto query{ createQuery<TrackListId>(session, params) };
|
||||
@@ -218,13 +218,13 @@ namespace lms::db
|
||||
TrackListEntry::pointer res;
|
||||
|
||||
auto entries = getEntries(Range{ pos, 1 });
|
||||
if (!entries.results.empty())
|
||||
res = entries.results.front();
|
||||
if (!entries.empty())
|
||||
res = entries.front();
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
RangeResults<ObjectPtr<TrackListEntry>> TrackList::getEntries(std::optional<Range> range) const
|
||||
std::vector<ObjectPtr<TrackListEntry>> TrackList::getEntries(std::optional<Range> range) const
|
||||
{
|
||||
assert(session());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user