Skip to content

Commit c7dd13d

Browse files
committed
Add missing images function
1 parent 2f05d65 commit c7dd13d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

app/resources/card_resource.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,4 +160,20 @@ class CardResource < ApplicationResource # rubocop:disable Metrics/ClassLength
160160
end
161161

162162
many_to_many :card_pools
163+
164+
private
165+
166+
def images(id, face_index = nil)
167+
url_prefix = Rails.configuration.x.printing_images.nrdb_classic_prefix
168+
face_suffix = "-#{face_index}" unless face_index.nil?
169+
{
170+
'nrdb_classic' => {
171+
'tiny' => "#{url_prefix}/tiny/#{id}#{face_suffix}.jpg",
172+
'small' => "#{url_prefix}/small/#{id}#{face_suffix}.jpg",
173+
'medium' => "#{url_prefix}/medium/#{id}#{face_suffix}.jpg",
174+
'large' => "#{url_prefix}/large/#{id}#{face_suffix}.jpg",
175+
'narrative' => "#{url_prefix}/large/#{id}#{face_suffix}-narrative.jpg"
176+
}
177+
}
178+
end
163179
end

0 commit comments

Comments
 (0)