mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 17:21:38 -05:00
Merge ced62253c9 into b4c2def2be
This commit is contained in:
commit
e67c46b4be
1 changed files with 11 additions and 2 deletions
|
|
@ -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 = []
|
||||
|
|
|
|||
Loading…
Reference in a new issue