zdavatz / oddb.org

Open Drug Database for Switzerland
https://ch.oddb.org
GNU General Public License v3.0
10 stars 8 forks source link

FI images are missing #254

Closed zdavatz closed 6 months ago

zdavatz commented 6 months ago

The images in the FI are missing here: https://ch.oddb.org/de/gcc/fachinfo/reg/57141

ngiger commented 6 months ago

Looks like we have a confusing with the path name. It could be found under /resources/images/fi/de/57141Leuprorelin_Sandoz_3_Monate__Fertigspritze_mit_Implantat_files/1.png But is referenced as /resources/images/fi/de/Leuprorelin_Sandoz_3_Monate__Implantat_files/1.png

zdavatz commented 6 months ago

Yes, the image is here:

https://ch.oddb.org/resources/images/fi/de/57141Leuprorelin_Sandoz_3_Monate__Fertigspritze_mit_Implantat_files/1.png

so why does it not work?

ngiger commented 6 months ago

The emitted path is/resources/images/fi/de/Leuprorelin_Sandoz_3_Monate__Implantat_files/1.png

zdavatz commented 6 months ago

why is the path wrong?

ngiger commented 6 months ago

Probably because auf https://github.com/zdavatz/oddb.org/commit/2f7a71466b21d190371b9a192294eac908a653bc But unfortunately no unit test checked the correct image path

ngiger commented 6 months ago

In the above mentioned the variable image_folder was not passed to parse_fachinfo_html. Also I think we should simplify the name of the image_folder only with the iksnr If you like the name we could just use the first 10 characters for me. It is hard to create a unit test for this, because extracting and parsing the uses a DRBObject fiparsed which is not available when running unittest on github

ngiger commented 6 months ago

Fixed the problem.

zdavatz commented 6 months ago

this commit seems to blow up the homepage. latest-screenshot

zdavatz commented 6 months ago

latest-screenshot

zdavatz commented 6 months ago

Import_daily ran as usual, these prodcuts where parsed today: 52412 ["de"] ATG-Fresenius 52412 ["fr"] ATG-Fresenius 53831 ["de"] Plaquenil 53831 ["fr"] Plaquenil 54868 ["de"] Zeffix 54868 ["fr"] Zeffix 61385 ["de"] Pradaxa 110 mg 61385 ["fr"] Pradaxa 110 mg 62235 ["de"] Clorazepate Zentiva 20 mg 62235 ["fr"] Clorazepate Zentiva 20 mg 62321 ["de"] Candesartan HCT Zentiva 8/12.5mg 62321 ["fr"] Candesartan HCT Zentiva 8/12.5mg 62960 ["de"] Escitalopram Zentiva 10 mg 62960 ["fr"] Escitalopram Zentiva 10 mg 68472 ["de"] Levodopa / Benserazid Devatis 62.5 mg (50 mg + 12.5 mg) 68472 ["fr"] Levodopa / Benserazid Devatis 62.5 mg (50 mg + 12.5 mg) 68502 ["de"] Zenon 10 mg/10 mg 68502 ["fr"] Zenon 10 mg/10 mg

ngiger commented 6 months ago

Homepage is working fine here. Did you reparse manually some FIs? Or was it import_daily?

zdavatz commented 6 months ago

Import_daily ran as usual. This is the import_daily job from today: https://github.com/zdavatz/oddb.org/issues/254#issuecomment-1963487626

zdavatz commented 6 months ago

PI titles also no longer work:

latest-screenshot

ngiger commented 6 months ago

When I look at view-source:https://ch.oddb.org/de/gcc/fachinfo/reg/52412 I see the reference to the image as IMG src="[/resources/images/fi/de/p_margin_top_0pt_margin_right_0pt_margin_bottom_0pt_margin_left_0pt__table_border_spacing_0pt_border_files/1.png](view-source:https://ch.oddb.org/resources/images/fi/de/p_margin_top_0pt_margin_right_0pt_margin_bottom_0pt_margin_left_0pt__table_border_spacing_0pt_border_files/1.png)" Whereas on my test server I find under view-source:http://localhost:8012/de/gcc/fachinfo/reg/52412 IMG src="[/resources/images/fi/de/52412_Grafalon/1.png](view-source:http://localhost:8012/resources/images/fi/de/52412_Grafalon/1.png)" My question is: Did you restart the services for fiparse after you pulled the changes? If not this explain the error.

ngiger commented 6 months ago

In general, after pulling a PR you should restart ALL services/ch.oddb*

zdavatz commented 6 months ago

Ok, this works for PI and FI. The fiparse process had to be restarted, before reparsing.