Skip to content

Commit

Permalink
Add additional metadata keys
Browse files Browse the repository at this point in the history
  • Loading branch information
mwalmsley authored May 16, 2024
1 parent 73f97e3 commit fa90f49
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions app/services/import/reduction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,19 @@ def unique_id
subject_metadata = payload.dig('subject', 'metadata')
return unless subject_metadata

# cosmic dawn metadata - may be marked as hidden (!id) or private (#id) metadata
# this is the standard gz metadata for all future uploads
unique_id = subject_metadata['!filename']
return unique_id if unique_id

# this catches various common (non-standard and to be avoided in future) variations
unique_id = subject_metadata['!Filename'] || subject_metadata['#filename'] || subject_metadata['#Filename'] || subject_metadata['filename'] || subject_metadata['Filename']
return unique_id if unique_id

# old cosmic dawn metadata - may be marked as hidden (!id) or private (#id) metadata
unique_id = subject_metadata['id'] || subject_metadata['!id'] || subject_metadata['#id']
return unique_id if unique_id

# decals metadata
# old decals metadata
unique_id = subject_metadata['#name']
return unique_id if unique_id

Expand Down

0 comments on commit fa90f49

Please sign in to comment.