diff options
Diffstat (limited to 'modules/convert/repository.go')
-rw-r--r-- | modules/convert/repository.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/convert/repository.go b/modules/convert/repository.go index 0f470144b4..813201ca68 100644 --- a/modules/convert/repository.go +++ b/modules/convert/repository.go @@ -91,6 +91,13 @@ func innerToRepo(repo *models.Repository, mode models.AccessMode, isParent bool) numReleases, _ := models.GetReleaseCountByRepoID(repo.ID, models.FindReleasesOptions{IncludeDrafts: false, IncludeTags: true}) + mirrorInterval := "" + if repo.IsMirror { + if err := repo.GetMirror(); err == nil { + mirrorInterval = repo.Mirror.Interval.String() + } + } + return &api.Repository{ ID: repo.ID, Owner: ToUser(repo.Owner, mode != models.AccessModeNone, mode >= models.AccessModeAdmin), @@ -134,5 +141,6 @@ func innerToRepo(repo *models.Repository, mode models.AccessMode, isParent bool) AllowSquash: allowSquash, AvatarURL: repo.AvatarLink(), Internal: !repo.IsPrivate && repo.Owner.Visibility == api.VisibleTypePrivate, + MirrorInterval: mirrorInterval, } } |