Rename the Fixer to Tune-up

Tab, URL (#/pair/<id>/tune-up; old fixer links still work), job names,
History trigger and docs now say Tune-up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
cdnutterandClaude Opus 5.5 committed 2026-09-30 10:21:45 -07:00
1 parent d8ad42c719
commit 7b180e26db
8 files changed
+21 -21

No files matched your search

+3 -3
View File
@@ -6,7 +6,7 @@ import (
"github.com/cdnutter/playlink/internal/engine"
)
// ---- step-by-step fixer ----
// ---- tune-up (step-by-step library fixing) ----
func (s *Server) handleFixer(w http.ResponseWriter, r *http.Request) {
id, _ := idParam(r)
@@ -43,7 +43,7 @@ func (s *Server) handleFixApply(w http.ResponseWriter, r *http.Request) {
if !readJSON(w, r, &body) {
return
}
if !s.preAction(w, r, id, "fixer") {
if !s.preAction(w, r, id, "tune-up") {
return
}
j, err := s.eng.StartFixApply(id, body)
@@ -51,7 +51,7 @@ func (s *Server) handleFixApply(w http.ResponseWriter, r *http.Request) {
opErr(w, err)
return
}
s.log.Info("fixer apply started", "pair", id, "selected", len(body.IDs))
s.log.Info("tune-up apply started", "pair", id, "selected", len(body.IDs))
writeJSON(w, 202, j)
}
+6 -6
View File
@@ -16,7 +16,7 @@ import (
"github.com/cdnutter/playlink/internal/store"
)
// The fixer takes each library through the same steps, the master first and
// The tune-up takes each library through the same steps, the master first and
// then the slave:
//
// 1. structure: every album in its own folder at the right depth (Artist/
@@ -62,7 +62,7 @@ type FixerState struct {
Link StepStatus `json:"link"`
}
// FixerStateOf reads a pair's fixer progress.
// FixerStateOf reads a pair's tune-up progress.
func FixerStateOf(p store.Pair) FixerState {
var s FixerState
if len(p.FixerState) > 0 {
@@ -204,7 +204,7 @@ func (e *Engine) StartFixCheck(pairID int64, c FixCheck) (*Job, error) {
if c.Step == StepTags && e.meta == nil {
return nil, errors.New("online lookup is not available")
}
return e.startJob(pairID, "fix-"+c.Step, func(ctx context.Context, j *Job) error {
return e.startJob(pairID, "tune-up "+c.Step, func(ctx context.Context, j *Job) error {
l, err := e.loadPair(ctx, pairID)
if err != nil {
return err
@@ -292,7 +292,7 @@ func (e *Engine) StartFixApply(pairID int64, req FixApply) (*Job, error) {
return nil, fmt.Errorf("%w: nothing selected", ErrInvalidBulk)
}
side, step := plan.Side, plan.Step
return e.startJob(pairID, "fix-"+step+"-apply", func(ctx context.Context, j *Job) error {
return e.startJob(pairID, "tune-up "+step+" (apply)", func(ctx context.Context, j *Job) error {
l, err := e.loadPair(ctx, pairID)
if err != nil {
return err
@@ -300,7 +300,7 @@ func (e *Engine) StartFixApply(pairID int64, req FixApply) (*Job, error) {
e.fixMu.Lock()
plan.Applied = true // paths and tags change: the plan is stale
e.fixMu.Unlock()
trigger := "fixer"
trigger := "tune-up"
edited := map[string]bool{}
if n := len(tagItems) + songsIn(albums); n > 0 {
j.phase("Updating tags", int64(n))
@@ -369,7 +369,7 @@ func (e *Engine) StartFixApply(pairID int64, req FixApply) (*Job, error) {
// Done when every fix was applied and nothing needs a person.
if !dry && skipped == 0 && applied >= plan.Fixable && plan.Blocked == 0 {
if err := e.SetStep(ctx, pairID, side, step, "done", fmt.Sprintf("%d fixed", applied)); err != nil {
e.log.Warn("fixer step not recorded", "err", err)
e.log.Warn("tune-up step not recorded", "err", err)
}
}
return nil