Commit 30f459fb authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

IPlaylist: Re-add some wrappers using a mediaId instead of a full media

parent 91777b7f
......@@ -58,6 +58,11 @@ public:
/// \return true on success, false on failure
///
virtual bool add( const IMedia& media, unsigned int position ) = 0;
/// Convenience wrappers
virtual bool append( int64_t mediaId ) = 0;
virtual bool add( const int64_t mediaId, unsigned int position ) = 0;
///
/// \brief move Change the position of a media
/// \param mediaId The media to move reorder
......
......@@ -203,6 +203,22 @@ bool Playlist::add( const IMedia& media, unsigned int position )
}
}
bool Playlist::append( int64_t mediaId )
{
auto media = m_ml->media( mediaId );
if ( media == nullptr )
return false;
return append( *media );
}
bool Playlist::add(const int64_t mediaId, unsigned int position)
{
auto media = m_ml->media( mediaId );
if ( media == nullptr )
return false;
return add( *media, position );
}
// Attach file object to Playlist
std::shared_ptr<File> Playlist::addFile( const fs::IFile& fileFs, int64_t parentFolderId,
bool isFolderFsRemovable )
......
......@@ -62,6 +62,8 @@ public:
const QueryParameters* params ) const override;
virtual bool append( const IMedia& media ) override;
virtual bool add( const IMedia& media, unsigned int position ) override;
virtual bool append( int64_t mediaId ) override;
virtual bool add( const int64_t mediaId, unsigned int position ) override;
virtual bool move( int64_t mediaId, unsigned int position ) override;
virtual bool remove( int64_t mediaId ) override;
std::shared_ptr<File> addFile( const fs::IFile& fileFs, int64_t parentFolderId,
......
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