Fix crash on adding Flickr photo (#4198)

* Update photo.rb

* Update photo.rb

* Update app/models/photo.rb

* Update app/models/photo.rb
This commit is contained in:
Daniel O'Connor
2025-09-02 02:17:28 +09:30
committed by GitHub
parent 110b18cc9e
commit b3ba05d834

View File

@@ -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,