wpoa / open-access-media-importer

A tool for harvesting media files from Open Access articles for upload into Wikimedia Commons
http://commons.wikimedia.org/wiki/User:Open_Access_Media_Importer_Bot
23 stars 8 forks source link

Avoid empty descriptions in template.py #88

Closed Daniel-Mietchen closed 10 years ago

Daniel-Mietchen commented 11 years ago

add check to https://github.com/erlehmann/open-access-media-importer/blob/4c7ded40e54e89507b1acb10f7c94374c2dd2468/helpers/template.py#L48 so that empty descriptions do not get posted with the {{en|1=}} envelope, as per http://commons.wikimedia.org/w/index.php?title=User_talk:Open_Access_Media_Importer_Bot&oldid=99490463#Category:Language_templates_with_no_text_displayed .

erlehmann commented 10 years ago

Assertion introduced as of ceba6b697726e559dbb254d340bf01cd6bcb4786. Bug will be closed as soon as I know what should be done instead.

Daniel-Mietchen commented 10 years ago

just leave the description field empty then - there is a Commons category that allows to track such cases.

Daniel-Mietchen commented 10 years ago

What we need to change is shown at https://commons.wikimedia.org/w/index.php?title=File:Motor-tics-evoked-by-striatal-disinhibition-in-the-rat-Movie1.ogv&diff=prev&oldid=105607572 .

erlehmann commented 10 years ago

Hopefully fixed as of 13cd48bb82fa9a5fff6946735383a6e207c2ab3b.

Daniel-Mietchen commented 10 years ago

Looks good, thanks.

Daniel-Mietchen commented 10 years ago

Did not work for https://commons.wikimedia.org/wiki/File:Side-effect-of-acting-on-the-world-acquisition-of-action-outcome-statistic-relation-alters-visual-Movie3.ogv .

erlehmann commented 10 years ago

The XML in question is:

      <supplementary-material content-type="local-data">
        <media xlink:href="Movie3.MOV">
          <caption>
            <p>Click here for additional data file.</p>
          </caption>
        </media>
      </supplementary-material>
erlehmann commented 10 years ago

See http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pmc&id=3782700

Daniel-Mietchen commented 10 years ago

Sure, but since we ignore statements containing "click", there should be no

{{en|1= }}

on the page, as this requires cleanup as per https://commons.wikimedia.org/w/index.php?title=File%3ASide-effect-of-acting-on-the-world-acquisition-of-action-outcome-statistic-relation-alters-visual-Movie3.ogv&diff=106524701&oldid=106502877 .

erlehmann commented 10 years ago

Let me find where the cleanup happens.

erlehmann commented 10 years ago

The description seems to be a single space.

Daniel-Mietchen commented 10 years ago

Yep. Where does that come from?

erlehmann commented 10 years ago

Whitespace issue should be fixed as of b91c061cceb38fceae556b950776f3a766f6da35.

erlehmann commented 10 years ago

I think the single space is an artifact of the cleanup process.

Daniel-Mietchen commented 10 years ago

Looks good, thanks. Next one is https://github.com/erlehmann/open-access-media-importer/issues/111 .