Create previously non-existent folios during mei indexing #892
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #889.
When chants end on a folio where no other chants begin, the folio does not exist in CantusDB but does have an MEI file. Folio A14r in Salzinnes is a good example of this:
There is only one line of music on this folio -- the ending of a chant that begins on the previous folio. Thus, we have no chant in CantusDB that has folio "A14r", but we do have a MEI file for folio "A14r" from the OMR process.
This PR modifies the index_manuscript_mei command to create a folio in such cases (we check that it's a "real" folio by making sure the mei file follows a naming convention and then create the folio if it doesn't exist). The user is alerted to this, and then must manually add the image_uri to the folio (either through the admin panel or the map folios process) and then reindex the mei. This process if further detailed in issue #891.
This is convoluted, but a more comprehensive solution (for example, by adjusting the map folios process) seems ill-advised at the moment given upcoming changes to the Cantus Ultimus data import and indexing process to more closely couple it to CantusDB. We'll want to come up with a better solution for these cases (hence, #891) after those changes. Note that this is also relevant to longstanding #628, which we should also come back to at that time.