Closed C0rn3j closed 5 years ago
This looks like the right thing to do when a single song's lyrics are requested, but perhaps not when a search/list is requested. We currently don't have such a separation (a short list gets served), but issue #4 mentions that it should be designed and added. Then, if a single record is requested and not found, it would be appropriate to serve a 404 error (and probably that's what will be used by plugins most of the time).
Here is a tricky thing about error pages in particular: we get a list of matches from the database, but not exact ones; it's easy when nothing at all is found, but there could be false positives with the current search implementation. A parameter can be added to check for those matches to be exact, but in some cases it would lead to failures even when the lyrics are there. Perhaps a score threshold could be used (for both listing and single song queries), but it would be tricky to calculate a sensible one on per-query basis.
Checked how lyrics.wikia.org deals with it: apparently there's a bit of preprocessing (removing anything in parens, "feat. <anything>" in artist names, etc), and then it goes for exact matches. Perhaps we should do something similar here.
Now a 404 error gets returned if the errors
parameter is set (e.g., errors=on
) while nothing is found. Does it fix the issue?
That should do it, I like the modularity, thanks!
I think it'd be nice if this was implemented, currently you just get an empty page like so, which is problematic when you want to look for errors in a script/plugin.
https://lyrics.rys.pw/?title=abcd