aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/convert/repository.go9
-rw-r--r--modules/structs/repo.go2
2 files changed, 11 insertions, 0 deletions
diff --git a/modules/convert/repository.go b/modules/convert/repository.go
index a356925539..1f11fda7ac 100644
--- a/modules/convert/repository.go
+++ b/modules/convert/repository.go
@@ -125,6 +125,13 @@ func innerToRepo(repo *repo_model.Repository, mode perm.AccessMode, isParent boo
}
}
+ var language string
+ if repo.PrimaryLanguage != nil {
+ language = repo.PrimaryLanguage.Language
+ }
+
+ repoAPIURL := repo.APIURL()
+
return &api.Repository{
ID: repo.ID,
Owner: ToUserWithAccessMode(repo.Owner, mode),
@@ -144,6 +151,8 @@ func innerToRepo(repo *repo_model.Repository, mode perm.AccessMode, isParent boo
CloneURL: cloneLink.HTTPS,
OriginalURL: repo.SanitizedOriginalURL(),
Website: repo.Website,
+ Language: language,
+ LanguagesURL: repoAPIURL + "/languages",
Stars: repo.NumStars,
Forks: repo.NumForks,
Watchers: repo.NumWatches,
diff --git a/modules/structs/repo.go b/modules/structs/repo.go
index 671885f20a..5a1e99e36b 100644
--- a/modules/structs/repo.go
+++ b/modules/structs/repo.go
@@ -59,6 +59,8 @@ type Repository struct {
Parent *Repository `json:"parent"`
Mirror bool `json:"mirror"`
Size int `json:"size"`
+ Language string `json:"language"`
+ LanguagesURL string `json:"languages_url"`
HTMLURL string `json:"html_url"`
SSHURL string `json:"ssh_url"`
CloneURL string `json:"clone_url"`