Skip to content

Commit

Permalink
Merge 8e65457 into 99208a2
Browse files Browse the repository at this point in the history
  • Loading branch information
david-caro committed Nov 21, 2017
2 parents 99208a2 + 8e65457 commit 0d44e7a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions invenio_oaiharvester/api.py
Expand Up @@ -91,12 +91,16 @@ def list_records(metadata_prefix=None, from_date=None, until_date=None,
# Use a dict to only return the same record once
# (e.g. if it is part of several sets)
records = {}
for spec in setspecs.split():
setspecs = setspecs.split() or [None]
for spec in setspecs:
params = {
'metadataPrefix': metadata_prefix or "oai_dc"
}
params.update(dates)
if spec:
params['set'] = spec
try:
for record in request.ListRecords(
metadataPrefix=metadata_prefix or "oai_dc",
set=spec,
**dates):
for record in request.ListRecords(**params):
records[record.header.identifier] = record
except NoRecordsMatch:
continue
Expand Down

0 comments on commit 0d44e7a

Please sign in to comment.