diff --git a/libsearch/index/index-scheduler.cpp b/libsearch/index/index-scheduler.cpp index accfb8f..5e8b483 100644 --- a/libsearch/index/index-scheduler.cpp +++ b/libsearch/index/index-scheduler.cpp @@ -76,7 +76,7 @@ IndexScheduler::IndexScheduler(QObject *parent) : void IndexScheduler::addNewPath(const QString &folders, const QStringList &blackList) { - if(m_indexStop.LOAD && m_contentIndexStop.LOAD && m_ocrContentIndexStop.LOAD) { + if(m_indexStop.LOAD && m_contentIndexStop.LOAD && m_ocrContentIndexStop.LOAD && m_aiIndexStartWaiting) { qDebug() << "Index Scheduler is being stopped, add operation will be executed when started up next time."; return; } @@ -94,6 +94,10 @@ void IndexScheduler::addNewPath(const QString &folders, const QStringList &black target |= BatchIndexer::Target::Ocr; m_statusRecorder->setStatus(OCR_CONTENT_INDEX_DATABASE_STATE_KEY, IndexStatusRecorder::State::Updating); } + if(m_config->isAiIndexEnable()) { + target |= BatchIndexer::Target::Ai; + m_statusRecorder->setStatus(AI_INDEX_DATABASE_STATE_KEY, IndexStatusRecorder::State::Updating); + } BatchIndexer::WorkMode mode = BatchIndexer::WorkMode::Add; startIndexJob(QStringList() << folders, blackList, mode, target); if(BatchIndexer::Target::None != target) {