app.views.previous_next_photos looks for the previous/next photos in a given map square.
Currently it does this by looking at the photos with the next lower/higher database id number. This relies on all photos in a given map square having sequential ids, which is something we do not guarantee. Currently it works because all of our methods for rebuilding the database do actually enter photos in order, but we shouldn't rely on this.
Instead, it should increment/decrement via Photo.number and Photo.folder.
app.views.previous_next_photos
looks for the previous/next photos in a given map square.Currently it does this by looking at the photos with the next lower/higher database id number. This relies on all photos in a given map square having sequential ids, which is something we do not guarantee. Currently it works because all of our methods for rebuilding the database do actually enter photos in order, but we shouldn't rely on this.
Instead, it should increment/decrement via Photo.number and Photo.folder.