Page MenuHomePhabricator

fileIsShared only works with Wikimedia and Wikitravel shared repository
Open, HighPublic

Description

Setting up a shared_image_repository for a family requires adding logic to page.fileIsShared, which is currently:

if not self.site.has_image_repository:
    return False
elif 'wikitravel_shared' in self.site.shared_image_repository():
    return self.fileUrl().startswith(
        u'http://wikitravel.org/upload/shared/')
else:
    return self.fileUrl().startswith(
        'https://upload.wikimedia.org/wikipedia/commons/')

Version: core-(2.0)
Severity: major
See Also:
T74846: generate_family_file.py fails on wiki-en.genealogy.net
T74873: Family generator detection (tracking)

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:55 AM
bzimport set Reference to bz72847.
bzimport added a subscriber: Unknown Object (????).

Site should use meta=filerepoinfo

https://www.mediawiki.org/wiki/API:Meta#filerepoinfo_.2F_fri

https://www.wikidata.org/w/api.php?action=query&meta=filerepoinfo&friprop=name%7Cdisplayname|rootUrl|local

https://en.wikipedia.org/w/api.php?action=query&meta=filerepoinfo&friprop=name%7Cdisplayname|rootUrl|local

The apiurl appears to no longer be in the returned data, and the rootUrl is not very helpful if we want to determine where the front end processor is for the shared repo.

But we can get the base URL of the images, which covers most of the needs of FilePage.

http://mapping.referata.com/w/api.php?action=query&meta=filerepoinfo&friprop=name%7Cdisplayname|rootUrl|local|apiURL

Change 181416 had a related patch set uploaded (by XZise):
[FEAT] Get shared FilePage and make checks dynamic

https://gerrit.wikimedia.org/r/181416

Patch-For-Review

Xqt triaged this task as High priority.May 28 2017, 11:54 AM