Commit 5447a042 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Task: Store the parent folder ID when creating a refresh task

(cherry picked from commit 7c93171f)
Signed-off-by: default avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent 06a8b81c
......@@ -551,13 +551,15 @@ Task::create( MediaLibraryPtr ml, std::string mrl, std::shared_ptr<fs::IFile> fi
std::shared_ptr<Task>
Task::createRefreshTask( MediaLibraryPtr ml, std::shared_ptr<File> file,
std::shared_ptr<fs::IFile> fileFs )
std::shared_ptr<fs::IFile> fileFs )
{
auto parentFolderId = file->folderId();
auto self = std::make_shared<Task>( ml, std::move( file ), std::move( fileFs ) );
const std::string req = "INSERT INTO " + Task::Table::Name +
"(mrl, file_type, file_id, is_refresh) VALUES(?, ?, ?, ?)";
"(mrl, file_type, file_id, parent_folder_id, is_refresh) "
"VALUES(?, ?, ?, ?, ?)";
if ( insert( ml, self, req, self->m_item.mrl(), self->m_item.file()->type(),
self->m_item.file()->id(), true ) == false )
self->m_item.file()->id(), parentFolderId, true ) == false )
return nullptr;
return self;
}
......
......@@ -226,8 +226,9 @@ public:
IFile::Type fileType,
std::pair<std::shared_ptr<Playlist>,
unsigned int> parentPlaylist );
static std::shared_ptr<Task> createRefreshTask( MediaLibraryPtr ml, std::shared_ptr<File> file,
std::shared_ptr<fs::IFile> fsFile );
static std::shared_ptr<Task> createRefreshTask( MediaLibraryPtr ml,
std::shared_ptr<File> file,
std::shared_ptr<fs::IFile> fsFile );
static void recoverUnscannedFiles( MediaLibraryPtr ml );
private:
......
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