sync: add dependency on flag to download file

This commit is contained in:
nemunaire 2018-09-07 20:53:08 +02:00 committed by Pierre-Olivier Mercier
commit 1e2a74f3ca
9 changed files with 112 additions and 16 deletions

View file

@ -115,7 +115,9 @@ func MyJSONTeam(t *Team, started bool) (interface{}, error) {
return nil, err
} else {
for _, f := range files {
exercice.Files = append(exercice.Files, myTeamFile{path.Join(FilesDir, f.Path), f.Name, hex.EncodeToString(f.Checksum), f.Size})
if t == nil || t.CanDownload(f) {
exercice.Files = append(exercice.Files, myTeamFile{path.Join(FilesDir, f.Path), f.Name, hex.EncodeToString(f.Checksum), f.Size})
}
}
}