/
githubmirror
/
photoprism
Обзор
Документация
Войти
/
githubmirror
/
photoprism
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
internal/entity/query/file_syncs.go
32 строки
623 B
Michael Mayer
Backend: Move customize, pwa, ttl, query, classify and nsfw packages
02 июл 2024, 08:36
02 июл 2024, 08:36
7f60af3
Код
Авторство
О чём код?
package query import ( "github.com/photoprism/photoprism/internal/entity" ) // FileSyncs returns a list of FileSync entities for a given account and status. func FileSyncs(accountId uint, status string, limit int) (result []entity.FileSync, err error) { s := Db().Where(&entity.FileSync{}) if accountId > 0 { s = s.Where("service_id = ?", accountId) } if status != "" { s = s.Where("status = ?", status) } s = s.Order("remote_name ASC") if limit > 0 { s = s.Limit(limit).Offset(0) } s = s.Preload("File") if err := s.Find(&result).Error; err != nil { return result, err } return result, nil }