Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cover request with Isbn13 #37

Merged
merged 5 commits into from
Jan 26, 2023
Merged

cover request with Isbn13 #37

merged 5 commits into from
Jan 26, 2023

Conversation

zimmp
Copy link
Collaborator

@zimmp zimmp commented Jan 26, 2023

cover request now with Isbn13 if available

closes ubpb/issues#72

cover request now with Isbn13  if available
@zimmp zimmp requested a review from renspr January 26, 2023 10:12
@@ -12,7 +12,7 @@ ruby:
div.align-self-start.text-center.text-muted.me-3(style="width: 55px; min-width: 55px; position: relative")
/ Cover Image
div.fa-regular.fa-file.fa-3x.bg-light.w-100.p-2.pt-3.pb-3.rounded
- isbn = record.additional_identifiers.select{|i| i.type == :isbn}.first&.value&.gsub("-", "")
- isbn = record.additional_identifiers.select{|i| i.type == :isbn && i.value&.length >= 13}.first&.value&.gsub("-", "")&.delete(" ")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Der Fix ist soweit super. Da wir hier nun aber eine Logik hinterlegen in der Form "der Service versteht nur 13 stellige ISBN-Nummern", frage ich mich, ob wir diese Logik nicht lieber in den CoverImagesController verlegen, und anstatt die ISBN-Nummer als Parameter zu übergeben, lieber die recordId übergeben. Der CoverImagesController müsse dann nochmal den Record anhand der ID aus ElasticSearch laden und dann die erste 13 stellige ISBN extrahieren.

Copy link
Collaborator Author

@zimmp zimmp Jan 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Klingt gut.
Werde das mal so wie beschrieben angehen.

@renspr renspr merged commit 95d8410 into master Jan 26, 2023
@renspr renspr deleted the missing-cover-images branch January 26, 2023 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants