mirror of
https://github.com/dkam/paapi.git
synced 2025-12-27 22:54:52 +00:00
Ensure Item#contributors always returns an Array. Safe navigator for Item#contributors_of compact - although not really neccessary now.
This commit is contained in:
@@ -51,18 +51,14 @@ module Paapi
|
|||||||
end
|
end
|
||||||
|
|
||||||
def contributors
|
def contributors
|
||||||
get(%w{ItemInfo ByLineInfo Contributors})
|
Array(get(%w{ItemInfo ByLineInfo Contributors}))
|
||||||
end
|
end
|
||||||
|
|
||||||
def contributors_of(kind)
|
def contributors_of(kind)
|
||||||
contributors&.select { |e| e['Role'] == kind.to_s.gsub(/([[:alpha:]]+)/) { |w| w.capitalize } }&.map do |e|
|
contributors&.select { |e| e['Role'] == kind.to_s.gsub(/([[:alpha:]]+)/).each { |w| w.capitalize } }&.map do |e|
|
||||||
r = e['Name']
|
r = e['Name']
|
||||||
Nameable(r) unless r.to_s.empty?
|
Nameable(r) unless r.to_s.empty?
|
||||||
end.compact
|
end&.compact
|
||||||
end
|
|
||||||
|
|
||||||
def contributors_of1(kind)
|
|
||||||
contributors&.select { |e| e['Role'] == kind.to_s.gsub(/([[:alpha:]]+)/) { |w| w.capitalize } }&.map { |e| Nameable(e['Name'])}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def actors
|
def actors
|
||||||
|
|||||||
Reference in New Issue
Block a user