craigsapp/website-polish-scores

Limit random choice of score to search paramters in URL

Closed this issue · 3 comments

The id random will display the work page of a random score:

https://polishscores.org/?id=random

Such as:

https://polishscores.org/?id=pl-kk--kk-i-336--002

Screenshot 2024-02-09 at 21 37 47

When search parameters are also given, then apply the search first, and then choose a random work from the search results.

For example

https://polishscores.org/?id=random&c=Gimeshoffer

Should return a random work from the list of three works by the composer Gimeshoffer:

Screenshot 2024-02-09 at 21 39 50

Sometimes the lyrics and pitch search indexes are not loaded from the server when loading a random work:

Screenshot 2024-02-10 at 14 14 20

Probably related to a limit in the number of active downloads from a single server in the web browser (they could be competing with the files downloaded when display the random work page). Try delaying download of these indexes (all the time, or when a random work is being loaded).

Random work from a library:

https://polishscores.org/?s=PL-Kc&id=random

goes in this case to https://polishscores.org/?id=pl-kc--40102-iii-1-saf--002-023

Screenshot 2024-02-10 at 17 25 44

Successive clicking on the random button in the navigator:

Screenshot 2024-02-10 at 17 27 12

will subsequently take you to other random works in the archive/library (since the PL-Kc library is selected on the browse page and a search has been done before choosing a random work in that library from the URL).