dbca-wa / wastdr

An R Client for the WA Sea Turtles and Strandings Database WAStD
https://dbca-wa.github.io/wastdr/
Other
3 stars 0 forks source link

Skip logic for Survey photos #53

Closed florianm closed 3 years ago

florianm commented 3 years ago

Skip uploading existing survey photos

florianm commented 3 years ago

An SVE photo which didn't get linked to a reconstructed Survey:

drake::loadd("odkc_tf")
drake::loadd("odkc_up")
drake::loadd("wastd_data_min")
att <- "/home/florianm/projects/etlTurtleNesting/media/1606434276689.jpg"
fs::file_exists(att) # attachment file does exist
sm <- odkc_tf$survey_media %>% dplyr::filter(attachment == att)
sm$source_id

wastd_data_min$survey_media %>% dplyr::filter(source_id == sm$source_id)

smup <- odkc_up$survey_media_create %>% dplyr::filter(source_id == sm$source_id)
# survey_source_id is NA = no survey adopted this attachment
florianm commented 3 years ago

Some SVE are not matched to SVS, therefore some survey media will be in "to be created" but the upload will fail gracefully on the missing survey.