@@ -74,7 +74,7 @@ class CardResource < ApplicationResource # rubocop:disable Metrics/ClassLength
74
74
75
75
unless @object . num_extra_faces . zero?
76
76
@object . face_indices . each do |index |
77
- f = { index :, images : images ( @object . latest_printing_id , index ) }
77
+ f = { index :, images : images ( @object . latest_printing_id , face_index : index ) }
78
78
f [ :base_link ] = @object . faces_base_link [ index ] if @object . faces_base_link [ index ]
79
79
f [ :display_subtypes ] = @object . faces_display_subtypes [ index ] if @object . faces_display_subtypes [ index ]
80
80
f [ :card_subtype_ids ] = @object . faces_card_subtype_ids [ index ] . compact if @object . faces_card_subtype_ids [ index ]
@@ -93,7 +93,7 @@ class CardResource < ApplicationResource # rubocop:disable Metrics/ClassLength
93
93
attribute :restrictions , :hash
94
94
attribute :latest_printing_id , :string
95
95
attribute :latest_printing_images , :hash do
96
- images ( @object . latest_printing_id )
96
+ images ( @object . latest_printing_id , has_narrative_image : @object . narrative_text . present? )
97
97
end
98
98
99
99
filter :card_cycle_id , :string do
@@ -163,10 +163,9 @@ class CardResource < ApplicationResource # rubocop:disable Metrics/ClassLength
163
163
164
164
private
165
165
166
- def images ( id , face_index = nil )
166
+ def images ( id , has_narrative_image : false , face_index : nil )
167
167
url_prefix = Rails . configuration . x . printing_images . nrdb_classic_prefix
168
168
face_suffix = "-#{ face_index } " unless face_index . nil?
169
- has_narrative_image = :narrative_text . presence && face_index . nil?
170
169
image_sizes = {
171
170
'tiny' => "#{ url_prefix } /tiny/#{ id } #{ face_suffix } .jpg" ,
172
171
'small' => "#{ url_prefix } /small/#{ id } #{ face_suffix } .jpg" ,
0 commit comments