Commit 87984070 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

Order albums & songs by their name

parent 2ad6f3a3
......@@ -84,7 +84,7 @@ std::vector<AlbumPtr> Artist::albums() const
return {};
static const std::string req = "SELECT alb.* FROM " + policy::AlbumTable::Name + " alb "
"LEFT JOIN AlbumArtistRelation aar ON aar.id_album = alb.id_album "
"WHERE aar.id_artist = ?";
"WHERE aar.id_artist = ? ORDER BY alb.title";
return Album::fetchAll( m_dbConnection, req, m_id );
}
......
......@@ -175,13 +175,13 @@ std::vector<MediaPtr> MediaLibrary::files()
std::vector<MediaPtr> MediaLibrary::audioFiles()
{
static const std::string req = "SELECT * FROM " + policy::MediaTable::Name + " WHERE type = ?";
static const std::string req = "SELECT * FROM " + policy::MediaTable::Name + " WHERE type = ? ORDER BY title";
return Media::fetchAll( m_dbConnection.get(), req, IMedia::Type::AudioType );
}
std::vector<MediaPtr> MediaLibrary::videoFiles()
{
static const std::string req = "SELECT * FROM " + policy::MediaTable::Name + " WHERE type = ?";
static const std::string req = "SELECT * FROM " + policy::MediaTable::Name + " WHERE type = ? ORDER BY title";
return Media::fetchAll( m_dbConnection.get(), req, IMedia::Type::VideoType );
}
......@@ -283,7 +283,9 @@ std::shared_ptr<Album> MediaLibrary::createAlbum(const std::string& title )
std::vector<AlbumPtr> MediaLibrary::albums()
{
return Album::fetchAll( m_dbConnection.get() );
static const std::string req = "SELECT * FROM " + policy::AlbumTable::Name +
" ORDER BY title ASC";
return Album::fetchAll( m_dbConnection.get(), req );
}
ShowPtr MediaLibrary::show(const std::string& name)
......
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