aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--skate/reduce.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/skate/reduce.go b/skate/reduce.go
index e169ce6..ed8035d 100644
--- a/skate/reduce.go
+++ b/skate/reduce.go
@@ -77,13 +77,13 @@ func ZippyExact(releases, refs io.Reader, matchResult MatchResult, w io.Writer)
continue
}
bref.Reset()
- bref.Key = fmt.Sprintf("%s_%d", ref.ReleaseIdent, ref.Index+1)
+ bref.Key = fmt.Sprintf("%s_%d", ref.ReleaseIdent, ref.Index)
bref.IndexedTs = ts
bref.SourceReleaseIdent = ref.ReleaseIdent
bref.SourceWorkIdent = ref.WorkIdent
bref.SourceReleaseStage = ref.ReleaseStage
bref.SourceYear = fmt.Sprintf("%d", ref.ReleaseYear)
- bref.RefIndex = ref.Index + 1 // we want 1-index (also helps with omitempty); TODO: was fixed with scholar:528804ad2e55983cf3e5e6659d8f46db0cab02b7
+ bref.RefIndex = ref.Index
bref.RefKey = ref.Key
bref.TargetReleaseIdent = target.Ident
bref.TargetWorkIdent = target.WorkID
@@ -134,7 +134,7 @@ func ZippyExactReleases(olr, releases io.Reader, matchResult MatchResult, w io.W
bref.SourceWorkIdent = re.WorkID
bref.SourceReleaseStage = re.ReleaseStage
bref.SourceYear = fmt.Sprintf("%d", re.ReleaseYear())
- bref.RefIndex = re.Extra.Skate.Ref.Index + 1 // we want 1-index (also helps with omitempty)
+ bref.RefIndex = re.Extra.Skate.Ref.Index
bref.RefKey = re.Extra.Skate.Ref.Key
bref.TargetOpenLibraryWork = target.WorkID
bref.MatchProvenance = re.Extra.Skate.Ref.Source
@@ -344,7 +344,7 @@ func ZippyVerifyRefsOpenLibrary(olr, refs io.Reader, w io.Writer) error {
bref.SourceWorkIdent = ref.WorkID
bref.SourceReleaseStage = ref.ReleaseStage
bref.SourceYear = fmt.Sprintf("%d", ref.ReleaseYear())
- bref.RefIndex = ref.Extra.Skate.Ref.Index + 1 // we want 1-index (also helps with omitempty)
+ bref.RefIndex = ref.Extra.Skate.Ref.Index
bref.RefKey = ref.Extra.Skate.Ref.Key
bref.TargetOpenLibraryWork = openLibraryWorkID
bref.MatchProvenance = ref.Extra.Skate.Ref.Source
@@ -400,7 +400,7 @@ func ZippyWayback(refs, cdx io.Reader, w io.Writer) error {
if ref.ReleaseYear > 1800 {
bref.SourceYear = fmt.Sprintf("%d", ref.ReleaseYear)
}
- bref.RefIndex = ref.Index + 1 // we want 1-index (also helps with omitempty)
+ bref.RefIndex = ref.Index
bref.RefKey = ref.Key
if cdx.NumRows == 0 {
bref.TargetURL = cdx.Line
@@ -564,7 +564,7 @@ func matchedRefsExtend(matched []*BiblioRef, refs []*Ref, stats *statsAugment) [
seen.Add(s)
}
for _, r := range refs {
- s := r.Key + fmt.Sprintf("%d", r.Index+1)
+ s := r.Key + fmt.Sprintf("%d", r.Index)
if seen.Contains(s) {
stats.skipMatchedRef++
log.Printf("skip-matched-ref [%d]: from %d matches; ident=%v, title=%s, key=%v, index=%d",