Commit 678a89fe authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Playlist: Add a fetcher by file id

parent e6d11bc0
......@@ -374,6 +374,13 @@ void Playlist::insertMrlFromMediaId( MediaLibraryPtr ml )
sqlite::Tools::executeDelete( ml->getConn(), "DELETE FROM PlaylistMediaRelation WHERE mrl IS NULL" );
}
std::shared_ptr<Playlist> Playlist::fromFile( MediaLibraryPtr ml, int64_t fileId )
{
static const std::string req = "SELECT * FROM " + Table::Name +
" WHERE file_id = ?";
return fetch( ml, req, fileId );
}
std::string Playlist::sortRequest( const QueryParameters* params )
{
std::string req = " ORDER BY ";
......
......@@ -84,6 +84,8 @@ public:
*/
static void insertMrlFromMediaId( MediaLibraryPtr ml );
static std::shared_ptr<Playlist> fromFile( MediaLibraryPtr ml, int64_t fileId );
private:
static std::string sortRequest( const QueryParameters* params );
void curateNullMediaID() const;
......
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