Skip to content

Commit

Permalink
Hotfix to prevent frozen string with 240
Browse files Browse the repository at this point in the history
  • Loading branch information
HirschSt committed Jul 22, 2020
1 parent 07d31f3 commit 3296a78
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/marc_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,33 +69,33 @@ def get_std_title
# Quartets
node = first_occurance("240", "a")
standard_title = node.content.truncate(50) if node && node.content
standard_title.strip! if standard_title
standard_title = standard_title.strip if standard_title

# try to get the description (240 m)
# vl (2), vla, vlc
node = first_occurance("240", "m")
scoring = node.content.truncate(50) if node && node.content
scoring.strip! if scoring
scoring = scoring.strip if scoring

node = first_occurance("240", "k")
extract = node.content.truncate(50) if node && node.content
extract.strip! if extract
extract = extract.strip if extract

node = first_occurance("240", "o")
arr = node.content.truncate(50) if node && node.content
arr.strip! if arr
arr = arr.strip if arr

node = first_occurance("383", "b")
opus = node.content.truncate(50) if node && node.content
opus.strip! if opus
opus = opus.strip if opus

node = first_occurance("690", "a")
cat_a = node.content.truncate(50) if node && node.content
cat_a.strip! if cat_a
cat_a = cat_a.strip if cat_a

node = first_occurance("690", "n")
cat_n = node.content.truncate(50) if node && node.content
cat_n.strip! if cat_n
cat_n = cat_n.strip if cat_n

cat_no = "#{cat_a} #{cat_n}".strip
cat_no = nil if cat_no.empty? # For the join only nil is skipped
Expand Down

0 comments on commit 3296a78

Please sign in to comment.