You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix original_filename of Images of Observations imported from iNat prior to Fri Dec 13 15:03:37 2024 -0800
They are blank, and should be updated to look like this:
The image.notes which need correction have aoriginal_name blank && notes in this form: "Imported from iNat 2024-09-24 14:59:20 +0000"
Last bad image:
irb(main):052>Image.where(Image[:notes] =~ /Imported from iNat/).where(original_name: "").order(created_at: :asc).last.idImageLoad(1651.9ms)SELECT`images`.* FROM`images`WHERE(`images`.`notes` REGEXP 'Imported from iNat') AND (`images`.`original_name` = '') ORDER BY `images`.`created_at` DESCLIMIT1=>1730052
Last bad Obs
Observation.joins(:images).where(images: [foo]).pluck(:id)ObservationPluck(292.8ms)SELECT`observations`.`id` FROM `observations` INNER JOIN `observation_images` ON `observation_images`.`observation_id` = `observations`.`id` INNER JOIN `images` ON `images`.`id` = `observation_images`.`image_id` WHERE `images`.`id` =1730052=>[567978]
Now it gets a little complicated.
For each bad, wait 1 second, hit the iNat API for bad.inat_id,
For each photo where photo notes are blank.
set photo notes == something in this form: iNat photo_id: 446732921, uuid: c8327b74-36c2-4600-8a90-3e45a8cb3f51
Fix
original_filename
of Images of Observations imported from iNat prior to Fri Dec 13 15:03:37 2024 -0800They are blank, and should be updated to look like this:
"iNat photo_id: 443196391, uuid: 9da79bb3-efc4-4ecd-8893-400b4d31c339"
I'll need to write script which:
original_filename
Tasks
The text was updated successfully, but these errors were encountered: