Use a configuration wrapper to handle loads and saves

This commit is contained in:
Jakob Borg
2014-10-06 09:25:45 +02:00
parent d476c2b613
commit 9b11609b63
12 changed files with 630 additions and 398 deletions

View File

@@ -42,13 +42,13 @@ func reportData(m *model.Model) map[string]interface{} {
res["version"] = Version
res["longVersion"] = LongVersion
res["platform"] = runtime.GOOS + "-" + runtime.GOARCH
res["numFolders"] = len(cfg.Folders)
res["numDevices"] = len(cfg.Devices)
res["numFolders"] = len(cfg.Folders())
res["numDevices"] = len(cfg.Devices())
var totFiles, maxFiles int
var totBytes, maxBytes int64
for _, folder := range cfg.Folders {
files, _, bytes := m.GlobalSize(folder.ID)
for folderID := range cfg.Folders() {
files, _, bytes := m.GlobalSize(folderID)
totFiles += files
totBytes += bytes
if files > maxFiles {