diff --git a/.app_version b/.app_version index c37136a8..ebf55b3d 100644 --- a/.app_version +++ b/.app_version @@ -1 +1 @@ -0.13.5 +0.13.6 diff --git a/.circleci/config.yml b/.circleci/config.yml index 064c38e9..d0055f31 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,7 +7,7 @@ orbs: jobs: test: docker: - - image: cimg/ruby:3.3 + - image: cimg/ruby:3.3.4 environment: RAILS_ENV: test - image: cimg/postgres:13.3 diff --git a/CHANGELOG.md b/CHANGELOG.md index f570d7dc..621af4c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [0.13.6] — 2024-09-13 + +### Fixed + +- Flatten geodata retrieved from Immich before processing it to prevent errors + + ## [0.13.5] — 2024-09-08 ### Added diff --git a/Gemfile.lock b/Gemfile.lock index 7af1c5d6..6e4cdb34 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -465,4 +465,4 @@ RUBY VERSION ruby 3.3.4p94 BUNDLED WITH - 2.5.9 + 2.5.18 diff --git a/app/services/immich/import_geodata.rb b/app/services/immich/import_geodata.rb index 6411c2aa..af59fdb5 100644 --- a/app/services/immich/import_geodata.rb +++ b/app/services/immich/import_geodata.rb @@ -44,15 +44,8 @@ class Immich::ImportGeodata end end - def valid?(asset) - asset.dig('exifInfo', 'latitude') && - asset.dig('exifInfo', 'longitude') && - asset.dig('exifInfo', 'dateTimeOriginal') - end - def parse_immich_data(immich_data) - geodata = immich_data.map do |asset| - log_no_data and next if asset_invalid?(asset) + geodata = immich_data.flatten.map do |asset| next unless valid?(asset) extract_geodata(asset) @@ -61,8 +54,10 @@ class Immich::ImportGeodata geodata.compact.sort_by { |data| data[:timestamp] } end - def asset_invalid?(bucket) - bucket.is_a?(Hash) && bucket['statusCode'] == 404 + def valid?(asset) + asset.dig('exifInfo', 'latitude') && + asset.dig('exifInfo', 'longitude') && + asset.dig('exifInfo', 'dateTimeOriginal') end def extract_geodata(asset)