Closed blackwinter closed 2 years ago
Would allow a more concise notation (and avoid "nesting hell").
Old:
if any_match("@LeaderPos06", "[ij]")
add_field("@facet_format", "Audio")
else
if any_match("@006Pos00", "[ij]")
add_field("@facet_format", "Audio")
else
if any_equal("@007Pos00", "s")
add_field("@facet_format", "Audio")
else
if any_equal("337 .a", "audio")
add_field("@facet_format", "Audio")
else
if any_equal("337 .b", "s")
add_field("@facet_format", "Audio")
else
if any_equal("338 .a", "Audiodisk")
add_field("@facet_format", "Audio")
else
paste("@type__008Pos26", "@type", "@008Pos26", join_char: "#")
if any_equal("@type__008Pos26", "CF#h")
add_field("@facet_format", "Audio")
else
paste("@006Pos00__006Pos09", "@006Pos00", "@006Pos09", join_char: "#")
if any_equal("@006Pos00__006Pos09", "m#h")
add_field("@facet_format", "Audio")
end
end
end
end
end
end
end
end
New (see also #165):
if any_match("@LeaderPos06", "[ij]")
add_field("@facet_format", "Audio")
elsif any_match("@006Pos00", "[ij]")
add_field("@facet_format", "Audio")
elsif any_equal("@007Pos00", "s")
add_field("@facet_format", "Audio")
elsif any_equal("337 .a", "audio")
add_field("@facet_format", "Audio")
elsif any_equal("337 .b", "s")
add_field("@facet_format", "Audio")
elsif any_equal("338 .a", "Audiodisk")
add_field("@facet_format", "Audio")
else
paste("@type__008Pos26", "@type", "@008Pos26", join_char: "#")
if any_equal("@type__008Pos26", "CF#h")
add_field("@facet_format", "Audio")
else
paste("@006Pos00__006Pos09", "@006Pos00", "@006Pos09", join_char: "#")
if any_equal("@006Pos00__006Pos09", "m#h")
add_field("@facet_format", "Audio")
end
end
end
Functional review: @TobiasNx Code review: @fsteeg
Metafix should allow multiple
elsif
statements inif
conditional, just like Catmandu.