/
githubmirror
/
photoprism
Обзор
Документация
Войти
/
githubmirror
/
photoprism
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
internal/entity/query/duplicates.go
24 строки
506 B
Michael Mayer
Config: Improve the naming of file and directory variables
13 сен 2024, 13:30
13 сен 2024, 13:30
0c1fdd6
Код
Авторство
О чём код?
package query import ( "strings" "github.com/photoprism/photoprism/internal/entity" ) // Duplicates finds duplicate files in the range of limit and offset sorted by file name. func Duplicates(limit, offset int, dir string) (files entity.Duplicates, err error) { if strings.HasPrefix(dir, "/") { dir = dir[1:] } stmt := Db() if dir != "" { stmt = stmt.Where("file_name LIKE ?", dir+"/%") } err = stmt.Order("file_name").Limit(limit).Offset(offset).Find(&files).Error return files, err }