Skip to content

Floraon URLs need fixing before enabling the provider #4817

Open

Description

Description

Floraon provider is disabled because many of its URLs are invalid, and the foreign_identifier is also sometimes invalid.

We should run a batched update query to fix the following:

  • remove the extra "%" in the foreign_identifier field: %flora-on.pt/Carduus-lusitanicus_ori_4OKo.jpg
  • replace "http://%" with "https://" in the url field http://%flora-on.pt/Carduus-lusitanicus_ori_4OKo.jpg
  • remove the extra "/index" in the foreign_landing_url: https://flora-on.pt/index.php?q=Carduus+lusitanicus
  • extract the filetype from the url

Query

SET updated_on = NOW(), foreign_identifier = TRIM(LEADING '%' FROM foreign_identifier), url = REPLACE(url, '[http://%](http://%25/)', 'https://'), filetype = CASE WHEN RIGHT(url, 4) = '.jpg' THEN 'jpg' ELSE null END

Additional context

This query should be fast since there are only 55,010 items from floraon.
After the catalog fix is deployed and the data refresh runs, we should enable this provider in the API admin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    • Status

      📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions