Fix 32-bit build, add 386 to CI, log scan completion
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package tui
|
||||
|
||||
import "sync"
|
||||
import (
|
||||
"math"
|
||||
"sync"
|
||||
)
|
||||
|
||||
// The stock 256-colour conversion maps dark, slightly tinted colours to
|
||||
// saturated cube entries (olive, navy), which wrecks the subtle shading the
|
||||
@@ -24,7 +27,7 @@ func quant256(c Color) uint8 {
|
||||
return v.(uint8)
|
||||
}
|
||||
r, g, b := int(c>>16&0xff), int(c>>8&0xff), int(c&0xff)
|
||||
best, bestD := 16, 1<<62
|
||||
best, bestD := 16, math.MaxInt
|
||||
for i := 0; i < 216; i++ {
|
||||
cr, cg, cb := cubeLevels[i/36], cubeLevels[i/6%6], cubeLevels[i%6]
|
||||
if d := redmean(r, g, b, cr, cg, cb); d < bestD {
|
||||
|
||||
@@ -10,6 +10,7 @@ package tui
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
@@ -324,6 +325,8 @@ func (m *Model) scanFinished() tea.Cmd {
|
||||
errs := st.TotalErrors()
|
||||
el := st.Elapsed()
|
||||
t.RUnlock()
|
||||
slog.Info("scan finished", "files", files, "dirs", st.Dirs, "bytes", total, "errors", errs,
|
||||
"cancelled", st.Cancelled, "elapsed", el)
|
||||
var cmds []tea.Cmd
|
||||
rate := float64(files+st.Dirs) / max(el.Seconds(), 0.001)
|
||||
msg := fmt.Sprintf("✓ Scan complete %s · %s files · %s dirs · %s · %s/s",
|
||||
|
||||
Reference in New Issue
Block a user