Commit d8e4a693 authored by Luni-4's avatar Luni-4 💬

Fix vlmc build

Use the latest version of medialibrary to build vlmc
parent 34dab072
......@@ -218,13 +218,13 @@ Library::onMediaAdded( std::vector<medialibrary::MediaPtr> mediaList )
}
void
Library::onMediaUpdated( std::vector<medialibrary::MediaPtr> mediaList )
Library::onMediaModified( std::vector<int64_t> mediaList )
{
for ( auto m : mediaList )
{
QMetaObject::invokeMethod( m_model, "updateMedia",
Qt::QueuedConnection,
Q_ARG( medialibrary::MediaPtr, m ) );
Q_ARG( int64_t, m ) );
}
}
......@@ -237,13 +237,18 @@ Library::onMediaDeleted( std::vector<int64_t> mediaList )
Q_ARG( int64_t, id ) );
}
void
Library::onMediaThumbnailReady( medialibrary::MediaPtr media, medialibrary::ThumbnailSizeType sizeType, bool success )
{
}
void
Library::onArtistsAdded( std::vector<medialibrary::ArtistPtr> )
{
}
void
Library::onArtistsModified( std::vector<medialibrary::ArtistPtr> )
Library::onArtistsModified( std::vector<int64_t> )
{
}
......@@ -258,7 +263,7 @@ Library::onAlbumsAdded( std::vector<medialibrary::AlbumPtr> )
}
void
Library::onAlbumsModified( std::vector<medialibrary::AlbumPtr> )
Library::onAlbumsModified( std::vector<int64_t> )
{
}
......@@ -289,7 +294,7 @@ Library::onDiscoveryProgress( const std::string& entryPoint )
}
void
Library::onDiscoveryCompleted( const std::string& entryPoint )
Library::onDiscoveryCompleted( const std::string& entryPoint, bool success )
{
if ( entryPoint.empty() == true )
QMetaObject::invokeMethod( m_model, "refresh",
......@@ -310,7 +315,7 @@ Library::onPlaylistsAdded( std::vector<medialibrary::PlaylistPtr> )
}
void
Library::onPlaylistsModified( std::vector<medialibrary::PlaylistPtr> )
Library::onPlaylistsModified( std::vector<int64_t> )
{
}
......@@ -325,16 +330,21 @@ Library::onReloadStarted( const std::string& )
}
void
Library::onReloadCompleted( const std::string& entryPoint )
Library::onEntryPointAdded( const std::string& entryPoint, bool success )
{
}
void
Library::onReloadCompleted( const std::string& entryPoint, bool success )
{
if ( entryPoint.empty() == true )
{
for ( auto media : m_ml->videoFiles() )
for ( auto media : m_ml->videoFiles()->all() )
QMetaObject::invokeMethod( m_model, "addMedia",
Qt::QueuedConnection,
Q_ARG( medialibrary::MediaPtr, media ) );
for ( auto media : m_ml->audioFiles() )
for ( auto media : m_ml->audioFiles()->all() )
QMetaObject::invokeMethod( m_model, "addMedia",
Qt::QueuedConnection,
Q_ARG( medialibrary::MediaPtr, media ) );
......@@ -359,5 +369,29 @@ Library::onEntryPointUnbanned( const std::string&, bool )
void
Library::onBackgroundTasksIdleChanged( bool )
{
}
void
Library::onGenresAdded( std::vector<medialibrary::GenrePtr> genres )
{
}
void
Library::onGenresModified( std::vector<int64_t> genres )
{
}
void
Library::onGenresDeleted( std::vector<int64_t> genreIds )
{
}
void
Library::onHistoryChanged( medialibrary::HistoryType type )
{
}
void
Library::onRescanStarted( )
{
}
......@@ -84,29 +84,36 @@ private:
private:
virtual void onMediaAdded( std::vector<medialibrary::MediaPtr> media ) override;
virtual void onMediaUpdated( std::vector<medialibrary::MediaPtr> media ) override;
virtual void onMediaModified( std::vector<int64_t> media ) override;
virtual void onMediaDeleted( std::vector<int64_t> ids ) override;
virtual void onMediaThumbnailReady( medialibrary::MediaPtr media, medialibrary::ThumbnailSizeType sizeType, bool success ) override;
virtual void onArtistsAdded( std::vector<medialibrary::ArtistPtr> artists ) override;
virtual void onArtistsModified( std::vector<medialibrary::ArtistPtr> artist ) override;
virtual void onArtistsModified( std::vector<int64_t> artist ) override;
virtual void onArtistsDeleted( std::vector<int64_t> ids ) override;
virtual void onAlbumsAdded( std::vector<medialibrary::AlbumPtr> albums ) override;
virtual void onAlbumsModified( std::vector<medialibrary::AlbumPtr> albums ) override;
virtual void onAlbumsModified( std::vector<int64_t> albums ) override;
virtual void onAlbumsDeleted( std::vector<int64_t> ids ) override;
virtual void onTracksAdded( std::vector<medialibrary::AlbumTrackPtr> tracks ) override;
virtual void onTracksDeleted( std::vector<int64_t> trackIds ) override;
virtual void onTracksAdded( std::vector<medialibrary::AlbumTrackPtr> tracks );
virtual void onTracksDeleted( std::vector<int64_t> trackIds );
virtual void onDiscoveryStarted( const std::string& entryPoint ) override;
virtual void onDiscoveryProgress( const std::string& entryPoint ) override;
virtual void onDiscoveryCompleted( const std::string& entryPoint ) override;
virtual void onDiscoveryCompleted( const std::string& entryPoint, bool success ) 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 onPlaylistsModified( std::vector<int64_t> playlists ) override;
virtual void onPlaylistsDeleted( std::vector<int64_t> playlistIds ) override;
virtual void onReloadStarted( const std::string& entryPoint ) override;
virtual void onReloadCompleted( const std::string& entryPoint ) override;
virtual void onReloadCompleted( const std::string& entryPoint, bool success ) override;
virtual void onEntryPointAdded( const std::string& entryPoint, bool success ) override;
virtual void onEntryPointRemoved( const std::string& entryPoint, bool success ) override;
virtual void onEntryPointBanned( const std::string& entryPoint, bool success ) override;
virtual void onEntryPointUnbanned( const std::string& entryPoint, bool success ) override;
virtual void onBackgroundTasksIdleChanged( bool isIdle ) override;
virtual void onGenresAdded( std::vector<medialibrary::GenrePtr> genres ) override;
virtual void onGenresModified( std::vector<int64_t> genres ) override;
virtual void onGenresDeleted( std::vector<int64_t> genreIds ) override;
virtual void onHistoryChanged( medialibrary::HistoryType type ) override;
virtual void onRescanStarted( ) override;
private:
std::unique_ptr<medialibrary::IMediaLibrary> m_ml;
......
......@@ -95,10 +95,10 @@ QVariant MediaLibraryModel::data( const QModelIndex &index, int role ) const
return QVariant( QUrl::fromPercentEncoding( QByteArray( m->title().c_str() ) ) );
#ifdef WITH_GUI
case Qt::DecorationRole:
return QPixmap( QString::fromStdString( m->thumbnail() ) );
return QPixmap( QString::fromStdString( m->thumbnailMrl(medialibrary::ThumbnailSizeType::Thumbnail) ) );
#endif
case Roles::ThumbnailPath:
return QVariant( QString::fromStdString( m->thumbnail() ) );
return QVariant( QString::fromStdString( m->thumbnailMrl(medialibrary::ThumbnailSizeType::Thumbnail) ) );
case Roles::Duration:
return QVariant::fromValue( m->duration() );
case Roles::Id:
......@@ -126,8 +126,8 @@ MediaLibraryModel::roleNames() const
void MediaLibraryModel::refresh()
{
beginResetModel();
const auto& audioFiles = m_ml.audioFiles();
const auto& videoFiles = m_ml.videoFiles();
const auto& audioFiles = m_ml.audioFiles()->all();
const auto& videoFiles = m_ml.videoFiles()->all();
m_media.insert( m_media.end(), audioFiles.begin(), audioFiles.end() );
m_media.insert( m_media.end(), videoFiles.begin(), videoFiles.end() );
endResetModel();
......
......@@ -205,7 +205,7 @@ Media::fromVariant( const QVariant& v )
QString
Media::snapshot()
{
return QString::fromStdString( m_mlMedia->thumbnail() );
return QString::fromStdString( m_mlMedia->thumbnailMrl(medialibrary::ThumbnailSizeType::Thumbnail) );
}
QSharedPointer<Clip>
......
......@@ -44,6 +44,7 @@
#include "Backend/MLT/MLTInput.h"
#include <medialibrary/IMedia.h>
#include <medialibrary/IMediaLibrary.h>
#include <medialibrary/IFile.h>
namespace Backend
......
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