Commit d1bb25ca authored by Duncan McNamara's avatar Duncan McNamara
Browse files

[WIP]

parent fe622c3a
......@@ -530,6 +530,7 @@ public:
virtual bool removeExternalMedia( MediaPtr media ) = 0;
virtual void removeThumbnails() = 0;
virtual void removeThumbnailsInDatabase() = 0;
/**
* @brief audioFiles Returns the media classified as Audio
......
......@@ -647,6 +647,23 @@ void MediaLibrary::removeThumbnails()
}
}
void MediaLibrary::removeThumbnailsInDatabase()
{
pauseBackgroundOperations();
waitForBackgroundTasksIdle();
auto t = m_dbConnection->newTransaction();
sqlite::Statement::FlushStatementCache();
auto dbConn = m_dbConnection.get();
std::string req = "DELETE FROM ThumbnailLinking;";
sqlite::Tools::executeRequest( dbConn, req );
req = "DELETE FROM ThumbnailCleanup";
sqlite::Tools::executeRequest( dbConn, req );
req = "DELETE FROM Thumbnail";
sqlite::Tools::executeRequest( dbConn, req );
resumeBackgroundOperations();
}
InitializeResult MediaLibrary::initialize( IMediaLibraryCb* mlCallback )
{
assert( !m_dbPath.empty() );
......
......@@ -340,6 +340,7 @@ private:
bool checkDatabaseIntegrity();
void registerEntityHooks();
void removeThumbnails() override;
void removeThumbnailsInDatabase() override;
void startThumbnailer() const;
protected:
......
Supports Markdown
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