Commit 3f797e4d authored by luyikei's avatar luyikei

Media: Fix saving/loading sub clips

Somehow we changed the saving format and didn't update it
parent 963f7edf
......@@ -83,11 +83,14 @@ Library::postLoad()
for ( const auto& var : m_settings->value( "medias" )->get().toList() )
{
auto map = var.toMap();
auto subClipsMap = map["clips"].toMap();
map["clips"] = QVariant();
auto m = Media::fromVariant( map );
addMedia( m );
m->loadSubclip( subClipsMap );
if ( map.contains( "clips" ) == true )
{
const auto& subClipsList = map["clips"].toList();
for ( const auto& subClip : subClipsList )
m->loadSubclip( subClip.toMap() );
}
}
}
......
......@@ -211,12 +211,12 @@ Media::snapshot()
QSharedPointer<Clip>
Media::loadSubclip( const QVariantMap& m )
{
if ( m.contains( "uuid" ) == false || m.contains( "begin" ) == false || m.contains( "end" ) == false )
if ( m.contains( "libraryUuid" ) == false || m.contains( "begin" ) == false || m.contains( "end" ) == false )
{
vlmcWarning() << "Invalid clip provided:" << m;
return {};
}
const auto& uuid = m["uuid"].toUuid();
const auto& uuid = m["libraryUuid"].toUuid();
const auto begin = m["begin"].toLongLong();
const auto end = m["end"].toLongLong();
auto clip = QSharedPointer<Clip>::create( sharedFromThis(), begin, end, uuid );
......
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