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

Library information not always loading #209

Closed craigsapp closed 1 year ago

craigsapp commented 1 year ago

Library information does not always load:

Screenshot 2023-01-10 at 11 08 13 AM

The archive for the physical object is NIFC, and it should be displaying on the right side of the page after the NIFC building logo and above the scan link.

The problem is that Chome only allows downloading six resources at a time from any particular website, and the library index is loaded after at least six other resources. And often downloading of the library index times out before it is loaded. (Firefox allows more simultaneous downloads from a particular website address).

The solution (which is partially implemented) is to embed the library and composer indices into the main index for the works. Then this delayed downloading and timeout will be avoided (or minimized).

craigsapp commented 1 year ago

The source of the problem is that the Siglum spreadsheet had a blank header cell instead of "Siglum" I noticed and fixed this sometime before Jan 10, but I have not remade the data server contents since then, so the index was missing a Siglum header. So the index on the data server remained having a problem.

Here is the siglum index file:

https://humdrum.nifc.pl/siglum-index.json

Click to see expected contents of Siglumn index ```json [ { "Siglum": "D-B", "RISM-ID": "30000655", "Name-long-PL": "Staatsbibliothek zu Berlin. Musikabteilung", "Name-short-PL": "Staatsbibliothek zu Berlin", "Name-long-EN": "Berlin State Library. music department", "Name-short-EN": "Berlin State Library", "Website-PL": "https://staatsbibliothek-berlin.de/en/", "Website-EN": "https://staatsbibliothek-berlin.de/en/", "NIFC-URL-PL": "", "NIFC-URL-EN": "" }, { "Siglum": "D-BNu", "RISM-ID": "30000696", "Name-long-PL": "Universitäts- und Landesbibliothek, Bonn", "Name-short-PL": "Universitätsbibliothek, Bonn", "Name-long-EN": "Bonn University and State Library", "Name-short-EN": "Bonn University Library", "Website-PL": "https://www.ulb.uni-bonn.de/en/", "Website-EN": "https://www.ulb.uni-bonn.de/en/", "NIFC-URL-PL": "", "NIFC-URL-EN": "" }, { "Siglum": "D-Dl", "RISM-ID": "30000042", "Name-long-PL": "Sächsische Landesbibliothek - Staats- und Universitätsbibliothek (SLUB), Dresden", "Name-short-PL": "SLUB Dresden", "Name-long-EN": "Sächsische Landesbibliothek - Staats- und Universitätsbibliothek (SLUB), Dresden", "Name-short-EN": "Dresden University Library", "Website-PL": "https://www.slub-dresden.de/en", "Website-EN": "https://www.slub-dresden.de/en", "NIFC-URL-PL": "", "NIFC-URL-EN": "" }, { "Siglum": "D-Hs", "RISM-ID": "30000225", "Name-long-PL": "Staats- und Universitätsbibliothek Carl von Ossietzky, Musiksammlung, Hamburg", "Name-short-PL": "Stabi, Hamburg", "Name-long-EN": "State and University Library Hamburg (Stabi)", "Name-short-EN": "Hamburg University Library", "Website-PL": "https://www.sub.uni-hamburg.de/en/service/english.html", "Website-EN": "https://www.sub.uni-hamburg.de/en/service/english.html", "NIFC-URL-PL": "", "NIFC-URL-EN": "" }, { "Siglum": "D-Mbs", "RISM-ID": "30000882", "Name-long-PL": "Bayerische Staatsbibliothek, München", "Name-short-PL": "BSB München", "Name-long-EN": "Bavarian State Library, Munich", "Name-short-EN": "Bavarian State Library", "Website-PL": "https://www.bsb-muenchen.de/en/", "Website-EN": "https://www.bsb-muenchen.de/en/", "NIFC-URL-PL": "", "NIFC-URL-EN": "" }, { "Siglum": "D-W", "RISM-ID": "30001032", "Name-long-PL": "Herzog August Bibliothek", "Name-short-PL": "Herzog August Bibliothek", "Name-long-EN": "Herzog August Library", "Name-short-EN": "Herzog August Library", "Website-PL": "", "Website-EN": "", "NIFC-URL-PL": "", "NIFC-URL-EN": "" }, { "Siglum": "F-Pn", "RISM-ID": "3000148", "Name-long-PL": "Bibliothèque nationale de France, Paris", "Name-short-PL": "BnF", "Name-long-EN": "National Library of France, Paris", "Name-short-EN": "French National Library", "Website-PL": "https://www.bnf.fr/en", "Website-EN": "https://www.bnf.fr/en", "NIFC-URL-PL": "", "NIFC-URL-EN": "" }, { "Siglum": "F-Ppo", "RISM-ID": "30003365", "Name-long-PL": "Biblioteka Polska w Paryżu", "Name-short-PL": "Biblioteka Polska w Paryżu", "Name-long-EN": "Polish Library in Paris", "Name-short-EN": "Polish Library in Paris", "Website-PL": "http://www.bibliotheque-polonaise-paris-shlp.fr/", "Website-EN": "http://www.bibliotheque-polonaise-paris-shlp.fr/", "NIFC-URL-PL": "", "NIFC-URL-EN": "" }, { "Siglum": "PL-CZ", "RISM-ID": "30002070", "Name-long-PL": "Archiwum OO. Paulinów na Jasnej Górze", "Name-short-PL": "Archiwum Jasnogórskie", "Name-long-EN": "Jasna Góra Monastery Archive", "Name-short-EN": "Jasna Góra Monastery", "Website-PL": "https://jasnagora.pl/pl/o-sanktuarium/biblioteki/biblioteka-jasnogorska", "Website-EN": "https://jasnagora.pl/en/o-sanktuarium/biblioteki/biblioteka-jasnogorska", "NIFC-URL-PL": "", "NIFC-URL-EN": "" }, { "Siglum": "PL-GD", "RISM-ID": "30002071", "Name-long-PL": "Polska Akademia Nauk Biblioteka Gdańska", "Name-short-PL": "Biblioteka Gdańska PAN", "Name-long-EN": "Polish Academy of Science, Gdańsk", "Name-short-EN": "Gdańsk Library PAoS", "Website-PL": "http://www.bgpan.gda.pl", "Website-EN": "https://bgpan.gda.pl/?lang=en", "NIFC-URL-PL": "", "NIFC-URL-EN": "" }, { "Siglum": "PL-Kc", "RISM-ID": "30002076", "Name-long-PL": "Muzeum Narodowe w Krakowie. Biblioteka Książąt Czartoryskich", "Name-short-PL": "Biblioteka Czartoryskich", "Name-long-EN": "Czartoryski Library, National Museum in Cracow", "Name-short-EN": "Czartoryski Library, Cracow", "Website-PL": "https://mnk.pl/oddzial/biblioteka-ksiazat-czartoryskich", "Website-EN": "https://mnk.pl/branch/the-princes-czartoyski-library", "NIFC-URL-PL": "", "NIFC-URL-EN": "" }, { "Siglum": "PL-Kd", "RISM-ID": "30002078", "Name-long-PL": "Klasztor OO. Dominikanów, Konwent Świętej Trójcy, Kraków", "Name-short-PL": "Klasztor OO. Dominikanów, Kraków", "Name-long-EN": "Dominican Monastery Library and Provincial Archives, Cracow", "Name-short-EN": "Dominican Monastery, Cracow", "Website-PL": "https://kolegium.dominikanie.pl/biblioteka/", "Website-EN": "https://kolegium.dominikanie.pl/biblioteka/", "NIFC-URL-PL": "", "NIFC-URL-EN": "" }, { "Siglum": "PL-Kj", "RISM-ID": "30002079", "Name-long-PL": "Biblioteka Jagiellońska", "Name-short-PL": "Biblioteka Jagiellońska", "Name-long-EN": "Jagiellonian University Libraries", "Name-short-EN": "Jagiellonian Library, Cracow", "Website-PL": "https://bj.uj.edu.pl", "Website-EN": "https://bj.uj.edu.pl/en_GB/start-en", "NIFC-URL-PL": "", "NIFC-URL-EN": "" }, { "Siglum": "PL-Kk", "RISM-ID": "30002080", "Name-long-PL": "Archiwum Krakowskiej Kapituły Katedralnej", "Name-short-PL": "Krakowska Kapituła Katedralna", "Name-long-EN": "Archives and Library of Cracow Cathedral Chapter", "Name-short-EN": "Wawel Cathedral, Cracow", "Website-PL": "http://akkk.com.pl", "Website-EN": "", "NIFC-URL-PL": "", "NIFC-URL-EN": "" }, { "Siglum": "PL-KOZmzk", "RISM-ID": "51000446", "Name-long-PL": "Muzeum Zamoyskich w Kozłówce", "Name-short-PL": "Muzeum Zamoyskich, Kozłówka", "Name-long-EN": "Zamoyski Museum in Kozłówka", "Name-short-EN": "Zamoyski Museum, Kozłówka", "Website-PL": "http://www.muzeumzamoyskich.pl", "Website-EN": "https://www-muzeumzamoyskich-pl.translate.goog/?_x_tr_sch=http&_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en", "NIFC-URL-PL": "", "NIFC-URL-EN": "" }, { "Siglum": "PL-SA", "RISM-ID": "30003584", "Name-long-PL": "Biblioteka Diecezjalna w Sandomierzu", "Name-short-PL": "Biblioteka Diecezjalna, Sandomierz", "Name-long-EN": "Diocesan Library in Sandomierz", "Name-short-EN": "Diocesan Library, Sandomierz", "Website-PL": "http://bc.bdsandomierz.pl/dlibra?language=pl", "Website-EN": "http://bc.bdsandomierz.pl/dlibra?language=en", "NIFC-URL-PL": "", "NIFC-URL-EN": "" }, { "Siglum": "PL-STAb", "RISM-ID": "30006288", "Name-long-PL": "Biblioteka Opactwa św. Wojciecha Sióstr Benedyktynek", "Name-short-PL": "Opactwo Benedyktynek, Staniątki", "Name-long-EN": "Benedictine Abbey of St. Adalbert, Staniątki", "Name-short-EN": "St. Adalbert Abbey, Staniątki", "Website-PL": "https://rism.info/library_collections/2017/09/28/music-in-the-convent-of-st-adalberts-abbey-in.html", "Website-EN": "https://rism.info/library_collections/2017/09/28/music-in-the-convent-of-st-adalberts-abbey-in.html", "NIFC-URL-PL": "", "NIFC-URL-EN": "" }, { "Siglum": "PL-Wn", "RISM-ID": "30000118", "Name-long-PL": "Biblioteka Narodowa", "Name-short-PL": "Biblioteka Narodowa", "Name-long-EN": "Polish National Library", "Name-short-EN": "Polish National Library", "Website-PL": "http://www.bn.org.pl", "Website-EN": "https://www.bn.org.pl/en", "NIFC-URL-PL": "", "NIFC-URL-EN": "" }, { "Siglum": "PL-Wnifc", "RISM-ID": "51003139", "Name-long-PL": "Narodowy Instytut Fryderyka Chopina", "Name-short-PL": "Instytut Chopina", "Name-long-EN": "The Fryderyk Chopin Institute", "Name-short-EN": "Chopin Institute, Warsaw", "Website-PL": "https://nifc.pl/pl", "Website-EN": "https://nifc.pl/en", "NIFC-URL-PL": "", "NIFC-URL-EN": "" }, { "Siglum": "PL-WRu", "RISM-ID": "30002111", "Name-long-PL": "Biblioteka Uniwersytecka we Wrocławiu", "Name-short-PL": "Biblioteka Uniwersytecka, Wrocław", "Name-long-EN": "Wrocław University Library", "Name-short-EN": "Wrocław University Library", "Website-PL": "https://www.bu.uni.wroc.pl/", "Website-EN": "https://www.bu.uni.wroc.pl/en", "NIFC-URL-PL": "", "NIFC-URL-EN": "" }, { "Siglum": "PL-Wtm", "RISM-ID": "30000150", "Name-long-PL": "Biblioteka Warszawskiego Towarzystwa Muzycznego im. Stanisława Moniuszki", "Name-short-PL": "Warszawskie Towarzystwo Muzyczne", "Name-long-EN": "Library, Museum and Archives of the Stanisław Moniuszko Warsaw Music Society", "Name-short-EN": "Warsaw Music Society", "Website-PL": "http://warszawskietowarzystwomuzyczne.pl/biblioteka/", "Website-EN": "", "NIFC-URL-PL": "https://chopin.nifc.pl/pl/chopin/instytucja/31", "NIFC-URL-EN": "https://chopin.nifc.pl/en/chopin/instytucja/31" }, { "Siglum": "PL-Wumfc", "RISM-ID": "30070232", "Name-long-PL": "Biblioteka Główna Uniwersytetu Muzycznego Fryderyka Chopina", "Name-short-PL": "Uniwersytet Muzyczny Chopina", "Name-long-EN": "Fryderyk Chopin Music Academy Main Library", "Name-short-EN": "Chopin University of Music", "Website-PL": "http://www.biblioteka.chopin.edu.pl/pl", "Website-EN": "", "NIFC-URL-PL": "", "NIFC-URL-EN": "" }, { "Siglum": "S-Uu", "RISM-ID": "30000253", "Name-long-PL": "Biblioteka Uniwersytecka w Uppsali, Carolina Rediviva", "Name-short-PL": "Biblioteka Uniwersytecka w Uppsali", "Name-long-EN": "Uppsala University Library, Carolina Rediviva", "Name-short-EN": "Uppsala University Library", "Website-PL": "https://www.ub.uu.se/?languageId=1", "Website-EN": "https://www.ub.uu.se/?languageId=1", "NIFC-URL-PL": "", "NIFC-URL-EN": "" }, { "Siglum": "SK-J", "RISM-ID": "30000578", "Name-long-PL": "Okresný archív Bratislava-vidiek, Svätý Jur, Slovakia", "Name-short-PL": "Okresný archív Bratislava-vidiek", "Name-long-EN": "State Archive for Rural Bratislava, Slovakia", "Name-short-EN": "Rural Bratislava Archive", "Website-PL": "", "Website-EN": "", "NIFC-URL-PL": "", "NIFC-URL-EN": "" } ] ```

Here is an example of the work pages now:

http://127.0.0.1:3434/?id=pl-kozmzk--mzk-m-10-ii

Screenshot 2023-03-23 at 3 34 13 PM

Also tooltips for library sigla on the browse page are working again:

Screenshot 2023-03-23 at 3 40 50 PM
jacekiwaszko1 commented 1 year ago

There are still some problems with the Siglum index. When you load the work page (eg. https://polishscores.org/?id=pl-kozmzk--mzk-m-10-ii) index is downloaded properly, and the Library information is displayed:

image

Then if you go back to the browse page by clicking on up-arrow the index works as expected (short names are displayed when hovering over a list of siglum works, Library info is displayed on other work pages).

But if you load the browse page first (https://polishscores.org), there's still an error reported in the console:

image

Therefore hovering over the siglum list returns dummy info:

image

And the library info is missing:

image

After reloading the work page the information is back (https://polishscores.org/?id=16xx:900):

image

craigsapp commented 1 year ago

Yes, it is annoying. I think this was also the state of affairs in December. Trying it today, sometimes the siglum index is downloaded successfully and sometimes not. I have tried several things so far and it does not make a difference:

It is could a suble bug in the data server script. For example I store the indexes in zipped format, and maybe I am adding an extra space at the end/beginning of the file which the web browser somehow ignore sometimes and not others. Also it seems to behave as a timeout when getting the file, which is either related to Apache or the Web browser. I found documentation that Chrome only downloads 6 resource files from any server at a time, and it pauses request for more files until some of the 6 it is downloading has been received. Perhaps Apache does something similar, but it takes too long until it gets around to the siglum index. I was thinking in December about merging the indexes for the works/sigla/composer/instruments into a single file to see if that fixes the problem (but haven't done that yet). Firefox has a higher resource limit download, but it still has the same problem as Chrome.

craigsapp commented 1 year ago

I moved the download of the siglum and instrument indexes before download of the main score index and this seems to fix the problem. My current guess is that the problem occurs in the Apache server, where there is some default limit on connections.

Screenshot 2023-04-08 at 21 00 10
craigsapp commented 1 year ago

Another possibility is to use .then:

https://stackoverflow.com/questions/40981040/using-a-fetch-inside-another-fetch-in-javascript

craigsapp commented 1 year ago

Seems to be working always now.