db: Add cksum_shown field to files in order to store second checksum in case of gziped content

This commit is contained in:
nemunaire 2022-10-31 18:29:41 +01:00
parent 91b2daea2e
commit 6b7ed273b7
5 changed files with 40 additions and 25 deletions

View file

@ -174,7 +174,11 @@ func MyJSONTeam(t *Team, started bool) (interface{}, error) {
} else {
for _, f := range files {
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})
cksum := f.Checksum
if len(f.ChecksumShown) > 0 {
cksum = f.ChecksumShown
}
exercice.Files = append(exercice.Files, myTeamFile{path.Join(FilesDir, f.Path), f.Name, hex.EncodeToString(cksum), f.Size})
}
}
}