Photo param parsing

This commit is contained in:
2024-02-24 15:11:20 +11:00
parent 8b6dd9d932
commit 12ad1666a2

View File

@@ -59,10 +59,16 @@ module Micropub
params[:properties][:content].first&.tr("\n", " ") params[:properties][:content].first&.tr("\n", " ")
end end
end end
photos = if params[:properties][:photo].is_a?(String) photos = if params[:properties][:photo].is_a?(Array)
params[:properties][:photo].map do |p|
{value: p, alt: ""}
end
elsif params[:properties][:photo].is_a?(Hash)
params[:properties][:photo]
elsif
{value: params[:properties][:photo], alt: ""} {value: params[:properties][:photo], alt: ""}
else else
params[:properties][:photo] || [] []
end end
new_params.merge({ new_params.merge({