fix(index):修复只打开AI索引时,删除AI索引目录失败的问题
This commit is contained in:
parent
348aceed1d
commit
9466ea7321
|
@ -121,6 +121,7 @@ bool AiIndexer::addImageFileIndex(const QJsonArray &object)
|
|||
bool AiIndexer::deleteFileIndex(const QStringList &files)
|
||||
{
|
||||
if(!AiIndexerPrivate::m_sessionValid) {
|
||||
qWarning() << "deleteFileIndex: Session is not valid";
|
||||
return false;
|
||||
}
|
||||
QJsonArray tmpArray;
|
||||
|
@ -130,8 +131,13 @@ bool AiIndexer::deleteFileIndex(const QStringList &files)
|
|||
oneFile.insert(QStringLiteral("filepath"), file);
|
||||
tmpArray.append(oneFile);
|
||||
}
|
||||
|
||||
return data_management_delete_files(AiIndexerPrivate::m_session, QJsonDocument(tmpArray).toJson().data()) == DataManagementResult::DATA_MANAGEMENT_SUCCESS;
|
||||
DataManagementResult result = data_management_delete_files(AiIndexerPrivate::m_session, QJsonDocument(tmpArray).toJson().data());
|
||||
if(result != DataManagementResult::DATA_MANAGEMENT_SUCCESS) {
|
||||
qWarning() << "Fail to call data_management_delete_files, input: " << QJsonDocument(tmpArray).toJson().data()
|
||||
<< "result:" << result;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AiIndexer::getAllIndexedFiles(QJsonObject &object)
|
||||
|
|
|
@ -107,7 +107,7 @@ void IndexScheduler::addNewPath(const QString &folders, const QStringList &black
|
|||
|
||||
void IndexScheduler::removeIndex(const QString &folders)
|
||||
{
|
||||
if(m_indexStop.LOAD && m_contentIndexStop.LOAD && m_ocrContentIndexStop.LOAD) {
|
||||
if(m_indexStop.LOAD && m_contentIndexStop.LOAD && m_ocrContentIndexStop.LOAD && m_aiIndexStop.LOAD) {
|
||||
qDebug() << "Index Scheduler is being stopped, remove operation will be executed when started up next time.";
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue