-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3423 Recording Panorama Dates and Histories from GSV API #3527
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay I didn't have time to do like a FULL review and test it, but I took a quick look and added some comments!
Adding a comment for myself: need to fix what happens in the case where i save null as the visited timestamp in the case that a row for that panorama already exists by adding logic to check if it's already in the table. |
Alright, edits up! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay review done! A bit more to restructure, but it's looking better!
public/javascripts/SVLabel/src/SVLabel/navigation/MapService.js
Outdated
Show resolved
Hide resolved
Alright, with the assumption that the differences in nullability in both validation and label are ok and that I can use the last_viewed field as opposed to creating a new pano_history_saved field, I went ahead and made all the changes. Once you okay them, I'll get rid of some code that's not necessary barring those conditions and push up a new commit! |
Ok, fixed that error I was talking about & the changes should be up! |
Ok, the way this works now is we just enter new entries in the PanoHistory table every time a panorama is visited on the frontend (at most 1x per mission), like previously. The PanoHistory table has an f-key to the gsv_data table (for location current pano Ids). Every pano in the history (including the current one at the location) is stored inside the PanoHistory table, since I figured we were kinda just storing stuff as opposed to being too worried about formatting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some final cleanup of things, simplifications, etc. Merging now!
Resolves #3423
In this PR, I implemented functionality to record all the panorama histories of each panorama that all users visit, and store them in a new table in the database in case we want to use that data later. I did this by first modifying the frontend to collect and keep track of the visited pano ids & histories given by the GSV API for each explore and validate mission that the user does. I then made a table in the database and wrote some backend code inside the existing explore and validate data submission routes to get that data from the frontend and store it in the new table.
The schema for the table is the following:
panorama_id (primary key)
visited_timestamp (timestamp)
pano_month (int)
pano_year (int)
location_current_pano_id (foreign key pointing to an existing panorama_id in the same table)
The idea here is that if we want to get all the previous panos at the same location as some pano, we can look for all panos with a location_current_pano_id matching that panorama's location_current_pano_id.
Testing instructions
Things to check before submitting the PR