mysociety / popit

DEPRECATED - Development on PopIt has stopped and it is no longer being maintained
https://goo.gl/Vvej4Q
Other
76 stars 33 forks source link

some image URLs are missing from export.json #827

Closed mhl closed 9 years ago

mhl commented 9 years ago

If you look at the bulk export of YourNextMP, the entries in the images array for some people have url and proxy_url members, but others don't:

https://yournextmp.popit.mysociety.org/api/v0.1/export.json

For example, Yvette Cooper has ID 2607 and the following images array:

      "images": [
        {
          "mime_type": "image/png",
          "notes": "Approved from photo moderation queue",
          "user_justification_for_use": "License: Open Government Licence v1.0\nSource: https://en.wikipedia.org/wiki/File:Yvette_Cooper_Ministerial_portrait.jpg\nAuthor: https://www.whatdotheyknow.com/request/119416/response/322984/attach/html/3/FOI%202455%20Photos.pdf.html",
          "md5sum": "95b743a734b69489fd63410bac667e59",
          "moderator_why_allowed": "other",
          "user_why_allowed": "other",
          "index": "first",
          "uploaded_by_user": "andylolz",
          "created": "2015-04-18T11:24:42.331Z",
          "local_path": "55/32/55323efa29c5d53959d9e460",
          "local_path_base": "55/32/55323efa29c5d53959d9e460",
          "start_date": null,
          "end_date": null,
          "birth_date": null,
          "death_date": null,
          "founding_date": null,
          "dissolution_date": null,
          "id": "55323efa29c5d53959d9e460"
        }
      ],

... while in PopIt, she has the url and proxy_url entries:

    "images": [
      {
        "proxy_url": "http://yournextmp.popit.mysociety.org/image-proxy/http%3A%2F%2Fyournextmp.popit.mysociety.org%2Fpersons%2F2607%2Fimage%2F55323efa29c5d53959d9e460",
        "url": "http://yournextmp.popit.mysociety.org/persons/2607/image/55323efa29c5d53959d9e460",
        "mime_type": "image/png",
        "notes": "Approved from photo moderation queue",
        "user_justification_for_use": "License: Open Government Licence v1.0\nSource: https://en.wikipedia.org/wiki/File:Yvette_Cooper_Ministerial_portrait.jpg\nAuthor: https://www.whatdotheyknow.com/request/119416/response/322984/attach/html/3/FOI%202455%20Photos.pdf.html",
        "md5sum": "95b743a734b69489fd63410bac667e59",
        "moderator_why_allowed": "other",
        "user_why_allowed": "other",
        "index": "first",
        "uploaded_by_user": "andylolz",
        "created": "",
        "local_path": "55/32/55323efa29c5d53959d9e460",
        "local_path_base": "55/32/55323efa29c5d53959d9e460",
        "start_date": null,
        "end_date": null,
        "birth_date": null,
        "death_date": null,
        "founding_date": null,
        "dissolution_date": null,
        "id": "55323efa29c5d53959d9e460"
      }
    ],
chrismytton commented 9 years ago

It's actually all images that are missing the proxy_image etc properties, but because we did the restore of the YNMP database a few weeks ago there are some bits that got written into the database that are normally dynamically.