Commit 5d8b00f9 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Task: Fetch the file first when restoring a task.

This will help us adjust the behavior when we can't find the filesystem
representation of a file
parent c3ff14ea
......@@ -133,6 +133,10 @@ bool Task::restoreLinkedEntities( )
if ( fsFactory == nullptr )
return false;
// First of all, we need to know if the file has been created already
// ie. have we run the MetadataParser service, at least partially
file = File::fetch( m_ml, m_fileId );
parentFolderFs = fsFactory->createDirectory( utils::file::directory( mrl ) );
if ( parentFolderFs == nullptr )
return false;
......@@ -147,9 +151,9 @@ bool Task::restoreLinkedEntities( )
}
fileFs = *it;
file = File::fetch( m_ml, m_fileId );
if ( file != nullptr )
media = file->media();
parentFolder = Folder::fetch( m_ml, m_parentFolderId );
if ( m_parentPlaylistId != 0 )
parentPlaylist = Playlist::fetch( m_ml, m_parentPlaylistId );
......
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