From b3ba05d8340162bb8c19e912efba2aa367960d62 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Tue, 2 Sep 2025 02:17:28 +0930 Subject: [PATCH] Fix crash on adding Flickr photo (#4198) * Update photo.rb * Update photo.rb * Update app/models/photo.rb * Update app/models/photo.rb --- app/models/photo.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/photo.rb b/app/models/photo.rb index 183fadceb..afc65875d 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -46,7 +46,8 @@ class Photo < ApplicationRecord flickr = owner.flickr info = flickr.photos.getInfo(photo_id: source_id) licenses = flickr.photos.licenses.getInfo - license = licenses.find { |l| l.id == info.license } + license = licenses.find { |l| l.id.to_i == info.license.to_i } + Rails.logger.error("Cannot find license: " + [info.license, licenses].inspect) unless license { title: calculate_title(info), license_name: license.name,