GrafeasGroup / blossom

The website. The app. The everything.
6 stars 3 forks source link

Simplify logic to find posts in `/find/` endpoint #236

Closed TimJentzsch closed 2 years ago

TimJentzsch commented 2 years ago

Relevant issue: Closes #234

Description:

The /find/ endpoint will now truncate the given URL to the minimal part that still contains the ID of the submission. It then tries to find the submission with a startswith filter.

This greatly simplifies the logic, because we don't have to handle transcriptions separately anymore. Additionally we can handle more types of URLs, for example claim/done comments can be found now. Transcriptions not being found has also been fixed.

The only downside is that it might be slower, because we cannot use simple equality checks anymore. Personally, I think this is worth it.

Checklist: