craigsapp / website-polish-scores

Front-end for digital transcriptions of the Polish Music Heritage in Open Access project
https://polishscores.org
3 stars 1 forks source link

Add library selection to URL browse parameters. #224

Closed craigsapp closed 1 year ago

craigsapp commented 1 year ago

In a manner similar to using the c parameters to select a particular composer when opening up the browse page, add another parameters for selecting the library:

Screenshot 2023-05-06 at 11 05 53 AM

In this case it might be:

https://polishscores.org/?s=pl-wru

Where s stands for siglum. Also possibly allow the exact RISM siglum, and possibly allow library/archive names to be given in this parameter.

craigsapp commented 1 year ago

Implemented in commit https://github.com/craigsapp/website-polish-scores/commit/671b5b949b49321b9e7162b2a6a340c87be8b82b

The URL parameter s can be all lowercase:

https://polishscores.org/?s=pl-wru

Or can be in the standard capitalization:

https://polishscores.org/?s=PL-WRu

(If there ever were two sigla that has the same lower-case value, then the upper-case versions are required to differentiate between then.

The full capitalization:

https://polishscores.org/?s=PL-WRu

Here is the resulting view of either of the above URLs:

Screenshot 2023-05-06 at 12 02 03 PM

The PL-WRu library is selected in the browse search fields, and the URL contains s=PL-WRu (lower case sigla will be converted to upper case form).

When searching for a particular composer, the c and s parameters in the URL will both be displayed:

Screenshot 2023-05-06 at 12 06 21 PM

https://polishscores.org/?c=Buchner%2C%20Philipp%20Friedrich&s=PL-WRu

(They can be in any order).

craigsapp commented 1 year ago

Commit https://github.com/craigsapp/website-polish-scores/commit/ffe73ab32400342becfa4be7259d060cde402bad adds the enhancements:

(1) The country code is optional:

https://polishscores.org/?s=wru https://polishscores.org/?s=WRu

These internally expand to:

https://polishscores.org/?s=PL-WRu

(2) Preference will be given to PL country prefix. If no library codes in PL match, then search non PL libraries for a matching siglum.

https://polishscores.org/?s=uu

will expand to

https://polishscores.org/?s=S-Uu

Screenshot 2023-05-06 at 12 11 23 PM
craigsapp commented 1 year ago

Commit https://github.com/craigsapp/website-polish-scores/commit/7c6da9b431671b396a14dd3f9398cc5c771c8d02 allows for improperly capitalized sigla: If the input sigla has incorrect capitalization, the first round of searching for the proper uppercase version will fail. After that, the lowercase version of the input siglum will be used to search for the proper RISM siglum.

Example:

https://polishscores.org?s=S-uU

will change automatically to

https://polishscores.org?s=S-Uu

Also

https://polishscores.org?s=UU

will change to

https://polishscores.org?s=S-Uu

Screenshot 2023-05-06 at 12 23 40 PM