2020-04-05 22:26:53 +02:00
|
|
|
package service
|
|
|
|
|
|
|
|
import (
|
|
|
|
"sync"
|
|
|
|
|
|
|
|
"github.com/photoprism/photoprism/internal/photoprism"
|
|
|
|
)
|
|
|
|
|
|
|
|
var onceIndex sync.Once
|
|
|
|
|
|
|
|
func initIndex() {
|
2020-05-06 10:35:41 +02:00
|
|
|
services.Index = photoprism.NewIndex(Config(), Classify(), NsfwDetector(), Convert())
|
2020-04-05 22:26:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func Index() *photoprism.Index {
|
|
|
|
onceIndex.Do(initIndex)
|
|
|
|
|
|
|
|
return services.Index
|
|
|
|
}
|