mirror of
https://github.com/dkam/paapi.git
synced 2025-12-28 07:04:53 +00:00
Merge branch 'master' into net_http
This commit is contained in:
@@ -54,32 +54,36 @@ module Paapi
|
||||
end
|
||||
|
||||
def contributors_of(kind)
|
||||
kind = kind.to_s.gsub(/([[:alpha:]]+)/) { |w| w.capitalize }
|
||||
contributors.select { |e| e['Role'] == kind }&.map { |e| e.dig('Name') }&.reject {|n| n.to_s.empty?}
|
||||
kind = kind.to_s.gsub(/([[:alpha:]]+)/) { |w| w.downcase }
|
||||
contributors.select { |e| e['RoleType'] == kind }&.map { |e| e.dig('Name') }&.reject {|n| n.to_s.empty?}
|
||||
end
|
||||
|
||||
def actors
|
||||
contributors_of 'Actor'
|
||||
contributors_of 'actor'
|
||||
end
|
||||
|
||||
def artists
|
||||
contributors_of 'Artist'
|
||||
contributors_of 'artist'
|
||||
end
|
||||
|
||||
def authors
|
||||
contributors_of 'Author'
|
||||
contributors_of 'author'
|
||||
end
|
||||
|
||||
def director
|
||||
contributors_of 'director'
|
||||
end
|
||||
|
||||
def illustrators
|
||||
contributors_of 'Illustrator'
|
||||
contributors_of 'illustrator'
|
||||
end
|
||||
|
||||
def narrators
|
||||
contributors_of 'Narrator'
|
||||
contributors_of 'narrator'
|
||||
end
|
||||
|
||||
def publishers
|
||||
contributors_of 'Publisher'
|
||||
contributors_of 'publisher'
|
||||
end
|
||||
|
||||
def languages
|
||||
|
||||
@@ -10,6 +10,7 @@ module Paapi
|
||||
|
||||
@items_data = @hash.dig('ItemsResult', 'Items')
|
||||
@items_data ||= @hash.dig('SearchResult', 'Items')
|
||||
@items_data ||= @hash.dig('VariationsResult', 'Items')
|
||||
@items_data ||= []
|
||||
|
||||
@items = @items_data.map {|d| Item.new(d)}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
module Paapi
|
||||
VERSION = '0.1.0'
|
||||
VERSION = '0.1.2'
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user