Compare commits

..

2 Commits

2 changed files with 14 additions and 2 deletions

View File

@ -25,10 +25,22 @@ SaveFileResult FileSaver::addFile(QString path)
QString absPath = info.absoluteFilePath(); QString absPath = info.absoluteFilePath();
auto mtime = info.lastModified().toSecsSinceEpoch(); auto mtime = info.lastModified().toSecsSinceEpoch();
if(this->dbService->fileExistsInDatabase(absPath, mtime))
bool exists = false;
if(this->fileSaverOptions.fillExistingContentless)
{
exists = this->dbService->fileExistsInDatabase(absPath, mtime, 'c');
}
else
{
exists = this->dbService->fileExistsInDatabase(absPath, mtime);
}
if(exists)
{ {
return SKIPPED; return SKIPPED;
} }
return saveFile(info); return saveFile(info);
} }

View File

@ -151,7 +151,7 @@ QSqlQuery SqliteDbService::exec(QString querystr, std::initializer_list<QVariant
} }
if(!query.exec()) if(!query.exec())
{ {
throw LooqsGeneralException("Error while trying to query for file existance: " + query.lastError().text()); throw LooqsGeneralException("Error while exec(): " + query.lastError().text());
} }
return query; return query;
} }