Skip to content

Commit

Permalink
Add id uniqueness filter to loc direct lookup output
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisrlc committed Oct 31, 2023
1 parent be73b21 commit c6f8346
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/qa/authorities/loc/generic_authority.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ def find_url(id)
private

# Reformats the data received from the LOC service
# Filters for id uniqueness
def parse_authority_response
@raw_response.select { |response| response[0] == "atom:entry" }.map do |response|
loc_response_to_qa(response_to_struct(response))
end
end.uniq { |result| result["id"] }
end

# Converts most of the atom data into an OpenStruct object.
Expand Down

0 comments on commit c6f8346

Please sign in to comment.