Skip to content

Commit

Permalink
oai: drop other params if resumptionToken is set
Browse files Browse the repository at this point in the history
  • Loading branch information
boutros committed Mar 13, 2019
1 parent 3350193 commit 68af639
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions oai/harvester.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,17 @@ func (h *Harvester) Run() error {
}

func (h *Harvester) fetch() ([]Record, error) {
url := h.endpoint + "?verb=ListRecords&metadataPrefix=" + h.MetadataPrefix
url := h.endpoint + "?verb=ListRecords"
if h.Token != "" {
url += "&resumptionToken=" + h.Token
}
if h.Set != "" {
url += "&set=" + h.Set
}
if !h.From.IsZero() {
url += "&from=" + h.From.String()
} else {
url += "&metadataPrefix=" + h.MetadataPrefix
if h.Set != "" {
url += "&set=" + h.Set
}
if !h.From.IsZero() {
url += "&from=" + h.From.String()
}
}
req, err := http.NewRequest("GET", url, nil)
if err != nil {
Expand Down

0 comments on commit 68af639

Please sign in to comment.