Handle and indicate duplicate repo ID:s (fixes #153)

This commit is contained in:
Jakob Borg
2014-04-27 21:53:27 +02:00
parent 89f5f3bf9a
commit dcd7d278aa
6 changed files with 41 additions and 9 deletions

View File

@@ -84,6 +84,13 @@ func restGetModel(m *Model, w http.ResponseWriter, r *http.Request) {
var repo = qs.Get("repo")
var res = make(map[string]interface{})
for _, cr := range cfg.Repositories {
if cr.ID == repo {
res["invalid"] = cr.Invalid
break
}
}
globalFiles, globalDeleted, globalBytes := m.GlobalSize(repo)
res["globalFiles"], res["globalDeleted"], res["globalBytes"] = globalFiles, globalDeleted, globalBytes