Commit 37615c86 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Reflect recent MediaLibrary API changes

parent 1f972ee8
......@@ -51,8 +51,8 @@ Library::Library( Settings* vlmcSettings, Settings *projectSettings )
// Setting up the external media library
m_ml.reset( NewMediaLibrary() );
m_ml->setVerbosity( medialibrary::LogLevel::Warning );
m_videoModel = new MediaLibraryModel( *m_ml, medialibrary::IMedia::Type::VideoType, this );
m_audioModel = new MediaLibraryModel( *m_ml, medialibrary::IMedia::Type::AudioType, this );
m_videoModel = new MediaLibraryModel( *m_ml, medialibrary::IMedia::Type::Video, this );
m_audioModel = new MediaLibraryModel( *m_ml, medialibrary::IMedia::Type::Audio, this );
auto s = vlmcSettings->createVar( SettingValue::List, QStringLiteral( "vlmc/mlDirs" ), QVariantList(),
"Media Library folders", "List of folders VLMC will search for media files",
......@@ -216,10 +216,10 @@ Library::onMediaAdded( std::vector<medialibrary::MediaPtr> mediaList )
{
switch ( m->type() )
{
case medialibrary::IMedia::Type::VideoType:
case medialibrary::IMedia::Type::Video:
m_videoModel->addMedia( m );
break;
case medialibrary::IMedia::Type::AudioType:
case medialibrary::IMedia::Type::Audio:
m_audioModel->addMedia( m );
break;
default:
......@@ -235,10 +235,10 @@ Library::onMediaUpdated( std::vector<medialibrary::MediaPtr> mediaList )
{
switch ( m->type() )
{
case medialibrary::IMedia::Type::VideoType:
case medialibrary::IMedia::Type::Video:
m_videoModel->updateMedia( m );
break;
case medialibrary::IMedia::Type::AudioType:
case medialibrary::IMedia::Type::Audio:
m_audioModel->updateMedia( m );
break;
default:
......@@ -327,3 +327,15 @@ Library::onParsingStatsUpdated( uint32_t percent )
{
emit progressUpdated( static_cast<int>( percent ) );
}
void Library::onPlaylistsAdded( std::vector<medialibrary::PlaylistPtr> )
{
}
void Library::onPlaylistsModified( std::vector<medialibrary::PlaylistPtr> )
{
}
void Library::onPlaylistsDeleted( std::vector<int64_t> )
{
}
......@@ -104,6 +104,9 @@ private:
virtual void onDiscoveryProgress( const std::string& entryPoint ) override;
virtual void onDiscoveryCompleted( const std::string& entryPoint ) override;
virtual void onParsingStatsUpdated( uint32_t percent ) override;
virtual void onPlaylistsAdded( std::vector<medialibrary::PlaylistPtr> playlists ) override;
virtual void onPlaylistsModified( std::vector<medialibrary::PlaylistPtr> playlists ) override;
virtual void onPlaylistsDeleted( std::vector<int64_t> playlistIds ) override;
private:
std::unique_ptr<medialibrary::IMediaLibrary> m_ml;
......
......@@ -144,10 +144,10 @@ void MediaLibraryModel::refresh()
switch ( m_mediaType )
{
case medialibrary::IMedia::Type::AudioType:
case medialibrary::IMedia::Type::Audio:
m_media = m_ml.audioFiles();
break;
case medialibrary::IMedia::Type::VideoType:
case medialibrary::IMedia::Type::Video:
m_media = m_ml.videoFiles();
break;
default:
......
......@@ -68,8 +68,7 @@ Media::Media( medialibrary::MediaPtr media, const QUuid& uuid /* = QUuid() */ )
Q_ASSERT( files.size() > 0 );
for ( const auto& f : files )
{
if ( f->type() == medialibrary::IFile::Type::Entire ||
f->type() == medialibrary::IFile::Type::Main )
if ( f->type() == medialibrary::IFile::Type::Main )
{
m_mlFile = f;
break;
......
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