implemented priority preloading

This commit is contained in:
ston1th 2022-05-03 22:14:47 +02:00
commit eb6272e411
7 changed files with 134 additions and 107 deletions

View file

@ -60,6 +60,7 @@ type file struct {
URI template.HTML
Anchor string
Status int
Prio int
Running bool
}
@ -136,12 +137,10 @@ func getPreloads(path string, fs *fs.FS) (dc dirContents) {
Name: template.HTML(p.Name),
URI: template.HTML(p.Name),
Status: p.Status,
Prio: p.Prio,
Running: p.Running,
})
}
slices.SortFunc(dc.Files, func(i, _ file) bool {
return i.Running
})
return
}