Commit 8b296948 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

History: Simplify streams history deletion

Dropping the table and recreating is how sqlite will handle a DELETE
FROM without a WHERE clause
parent ecf20043
......@@ -87,13 +87,8 @@ std::vector<HistoryPtr> History::fetch( MediaLibraryPtr ml )
bool History::clearStreams( MediaLibraryPtr ml )
{
static const std::string req = "DROP TABLE " + policy::HistoryTable::Name;
auto dbConn = ml->getConn();
if ( sqlite::Tools::executeRequest( dbConn, req ) == false )
return false;
if ( createTable( dbConn ) == false )
return false;
return true;
static const std::string req = "DELETE FROM " + policy::HistoryTable::Name;
return sqlite::Tools::executeRequest( ml->getConn(), req );
}
MediaPtr History::media() const
......
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