Closed KCI-Ablowers closed 5 years ago
This error is occurring because there are multiple inspections for the same structure on the same day that have photos:
Note that the filename 0320047.001-ILL-20190528.jpg is shown 3 times with 3 different INSPECTION_IDs. Therefore, when the program attempts to ZIP the files, it gets an error because the file already exists when writing the second/third photo file. The file naming only works within an inspection, and it will not track duplicates (and count upward with A, B, C, etc.) over file names between multiple inspections.
In any case, I think this is just an artifact from testing and resubmitting the same inspection multiple times, creating duplicates, so this shouldn't happen in production, as you will get a duplicate inspection warning flag during AGOL sync. This is also a case that I had some concerns about previously with BMP inspections, but during discussions it was agreed upon that multiple inspections of the same BMP on the same day wouldn't happen. If that is the case as well with IDDE, then, we should be good to leave it as-is, especially with the duplicate flagging.
For testing out this functionality fully, we may need to resync and submit a 1-2 new inspections to check that the photos are coming through as expected. I"m pretty sure it works, however, as I have not modified it since the initial deployment.
Understood, and that makes sense. I wasn't aware that this would cause an error so I didn't think to clean up my duplicate test inspections. I will submit a couple more, sync and push to SHA. I think #311 cleared up the duplicate check issue given the 2 inspection potential for IDDE. I'll leave this open for now.
@KCI-Ablowers, as long as the follow ups don't happen on the same day (which would produce duplicate filenames), then we should be okay. If there can be multiple followups on the same day, then we'll need to look at ways to differentiate the filenames across inspections.
@johnshiu I confirmed with Brent that there is the potential for the inspections to happen on the same day. Maybe we could add an "S" for "Standard" and an "F" for "Follow-Up" to the photo name using the inspection type? There is the potential for a structure to have one or more standard inspections, but they likely wouldn't be on the same day due to the need for dry time. A structure would only have one follow-up inspection.
@KCI-Ablowers, thanks for the clarification. I have added the S and F to the filenames to differentiate the different inspection sequence values. It will look like:
0300091.001-S-ILL-20190528.jpg 0300091.001-F-ILL-20190528.jpg
Please let me know if you have any questions or run into any issues.
I think that change should solve the issue.
Thanks!
@johnshiu I got an error when attempting to download the IDDE photos for watermarking from the UI.
URL - https://maps.roads.maryland.gov/NPDESFieldManagement/api/FMApi/GetZippedIDDEInspectionPhotos?p_request_id=3532