[UI/MOBILE] WIP on internal path support

This commit is contained in:
emeric
2016-03-06 00:44:24 +01:00
parent a07704c218
commit f8c808433f
34 changed files with 696 additions and 454 deletions
+13 -2
View File
@@ -17,7 +17,7 @@
* along with LMS. If not, see <http://www.gnu.org/licenses/>.
*/
#include <Wt/WApplication>
#include "LmsApplication.hpp"
#include "utils/Utils.hpp"
@@ -45,11 +45,22 @@ ArtistView::ArtistView(Wt::WContainerWidget *parent)
Artist::id_type id;
if (readAs(strId, id))
releases->search(SearchFilter::ById(SearchFilter::Field::Artist, id), 20);
{
Wt::Dbo::Transaction transaction(DboSession());
auto artist = Artist::getById(DboSession(), id);
releases->search(SearchFilter::ById(SearchFilter::Field::Artist, id), 20, artist ? Wt::WString::fromUTF8(artist->getName()) : "Unknown artist");
}
}, std::placeholders::_1));
}
Wt::WLink
ArtistView::getLink(Database::Artist::id_type id)
{
return Wt::WLink(Wt::WLink::InternalPath, "/audio/artist/" + std::to_string(id));
}
} //namespace Mobile
} //namespace UserInterface