This commit is contained in:
Lukas Kühne 2025-12-30 17:58:08 -08:00 committed by GitHub
commit e67c46b4be
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -7,8 +7,8 @@ class Immich::RequestPhotos
@user = user
@immich_api_base_url = URI.parse("#{user.safe_settings.immich_url}/api/search/metadata")
@immich_api_key = user.safe_settings.immich_api_key
@start_date = start_date
@end_date = end_date
@start_date = normalize_date(start_date)
@end_date = normalize_date(end_date)
end
def call
@ -22,6 +22,15 @@ class Immich::RequestPhotos
private
def normalize_date(raw_date)
return nil if raw_date.nil?
time = Time.zone.parse(raw_date.to_s)
time.utc.iso8601
rescue ArgumentError => e
raise ArgumentError, "Invalid date format for '#{raw_date}': #{e.message}"
end
def retrieve_immich_data
page = 1
data = []