Do not display show more for playlist if no playlist is found
This commit is contained in:
@@ -83,7 +83,12 @@ Playlist::getTracks(int offset, int size, bool& moreResults) const
|
||||
|
||||
moreResults = false;
|
||||
|
||||
Wt::Dbo::collection<Wt::Dbo::ptr<PlaylistEntry>> entries = session()->find<PlaylistEntry>().where("playlist_id = ?").bind(self().id()).orderBy("pos").offset(offset).limit(size + 1);
|
||||
Wt::Dbo::collection<Wt::Dbo::ptr<PlaylistEntry>> entries
|
||||
= session()->find<PlaylistEntry>()
|
||||
.where("playlist_id = ?").bind(self().id())
|
||||
.orderBy("pos")
|
||||
.limit(size != -1 ? size + 1 : -1)
|
||||
.offset(offset);
|
||||
|
||||
std::vector<Wt::Dbo::ptr<Track>> res;
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ Playlist::Playlist(Wt::WContainerWidget* parent)
|
||||
|
||||
_showMore = new Wt::WTemplate(Wt::WString::tr("template-show-more"));
|
||||
_showMore->addFunction("tr", &Wt::WTemplate::Functions::tr);
|
||||
_showMore->setHidden(true);
|
||||
container->bindWidget("show-more", _showMore);
|
||||
|
||||
_showMore->clicked().connect(std::bind([=]
|
||||
|
||||
Reference in New Issue
Block a user