mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 08:44:04 +01:00
Backend: Rename repo package to query
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
@@ -14,7 +14,7 @@ import (
|
||||
"github.com/photoprism/photoprism/internal/event"
|
||||
"github.com/photoprism/photoprism/internal/form"
|
||||
"github.com/photoprism/photoprism/internal/photoprism"
|
||||
"github.com/photoprism/photoprism/internal/repo"
|
||||
"github.com/photoprism/photoprism/internal/query"
|
||||
"github.com/photoprism/photoprism/internal/util"
|
||||
)
|
||||
|
||||
@@ -23,7 +23,7 @@ func GetLabels(router *gin.RouterGroup, conf *config.Config) {
|
||||
router.GET("/labels", func(c *gin.Context) {
|
||||
var f form.LabelSearch
|
||||
|
||||
r := repo.New(conf.OriginalsPath(), conf.Db())
|
||||
q := query.New(conf.OriginalsPath(), conf.Db())
|
||||
err := c.MustBindWith(&f, binding.Form)
|
||||
|
||||
if err != nil {
|
||||
@@ -31,7 +31,7 @@ func GetLabels(router *gin.RouterGroup, conf *config.Config) {
|
||||
return
|
||||
}
|
||||
|
||||
result, err := r.Labels(f)
|
||||
result, err := q.Labels(f)
|
||||
if err != nil {
|
||||
c.AbortWithStatusJSON(400, gin.H{"error": util.UcFirst(err.Error())})
|
||||
return
|
||||
@@ -55,9 +55,9 @@ func LikeLabel(router *gin.RouterGroup, conf *config.Config) {
|
||||
return
|
||||
}
|
||||
|
||||
r := repo.New(conf.OriginalsPath(), conf.Db())
|
||||
q := query.New(conf.OriginalsPath(), conf.Db())
|
||||
|
||||
label, err := r.FindLabelByUUID(c.Param("uuid"))
|
||||
label, err := q.FindLabelByUUID(c.Param("uuid"))
|
||||
|
||||
if err != nil {
|
||||
c.AbortWithStatusJSON(404, gin.H{"error": util.UcFirst(err.Error())})
|
||||
@@ -88,9 +88,9 @@ func DislikeLabel(router *gin.RouterGroup, conf *config.Config) {
|
||||
return
|
||||
}
|
||||
|
||||
r := repo.New(conf.OriginalsPath(), conf.Db())
|
||||
q := query.New(conf.OriginalsPath(), conf.Db())
|
||||
|
||||
label, err := r.FindLabelByUUID(c.Param("uuid"))
|
||||
label, err := q.FindLabelByUUID(c.Param("uuid"))
|
||||
|
||||
if err != nil {
|
||||
c.AbortWithStatusJSON(404, gin.H{"error": util.UcFirst(err.Error())})
|
||||
@@ -131,7 +131,7 @@ func LabelThumbnail(router *gin.RouterGroup, conf *config.Config) {
|
||||
return
|
||||
}
|
||||
|
||||
r := repo.New(conf.OriginalsPath(), conf.Db())
|
||||
q := query.New(conf.OriginalsPath(), conf.Db())
|
||||
|
||||
gc := conf.Cache()
|
||||
cacheKey := fmt.Sprintf("label-thumbnail:%s:%s", labelUUID, typeName)
|
||||
@@ -142,7 +142,7 @@ func LabelThumbnail(router *gin.RouterGroup, conf *config.Config) {
|
||||
return
|
||||
}
|
||||
|
||||
file, err := r.FindLabelThumbByUUID(labelUUID)
|
||||
file, err := q.FindLabelThumbByUUID(labelUUID)
|
||||
|
||||
if err != nil {
|
||||
log.Errorf(err.Error())
|
||||
|
||||
Reference in New Issue
Block a user