Add more details to image repository information
Open, NormalPublic

Description

I would really like, for both shared DB repos and API repos:

  • The canonical name of the file namespace on that wiki (for constructing URLs)
  • The article path on that wiki (for constructing different URLs)

I can't currently think of anything else crucial, but that's life.

I'd also in the future like a small icon that can represent the repository in the media viewer - right now we have a hacked-together icon that screams "not Commons" but still looks like a central repository icon. I'd be really happy to put a Wikipedia logo there if applicable.


Version: 1.23.0
Severity: normal

Details

Reference
bz59925
bzimport raised the priority of this task from to Normal.
bzimport set Reference to bz59925.
Tgr added a comment.Jan 10 2014, 10:25 PM

The siteinfo API returns all this (except for the favicon). So maybe we should return a link to the API endpoint in the repoinfo (assuming there is an API)? That would mean an additional, cross-domain request for the media viewer, but otherwise pretty easy to do and probably covers all the things Mark could not as well :)

As for the small icon, we could just add a link to the favicon to the siteinfo.

Tgr added a comment.Jan 10 2014, 10:26 PM

could not <- could not think of

Yeah, but it would mean setting up CORS if you want to use the media viewer, which won't necessarily be possible for e.g. third parties using instantcommons.

I think the articlePath being in the repo information isn't such a terrible thing...

Tgr added a comment.Jan 10 2014, 11:41 PM

Public information is available via JSONP, and the mediaviewer only uses public information (maybe except gender?).

That said, maybe we could include something like '\\example.org\wiki\File:$1' where you just have to plug in the file name? That takes care of both the (possibly localized) namespace name and the article path, and it has enough relation to the file repository that it makes sense to put it in the repoinfo.

You can use action=query&meta=filerepoinfo to get some information for file repos.

Change 107127 had a related patch set uploaded by Gergő Tisza:
Add $wgFavicon to siteinfo API

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

Tgr added a comment.Jan 13 2014, 11:26 AM

(In reply to comment #4)

Public information is available via JSONP, and the mediaviewer only uses
public information (maybe except gender?).

Apparently gender is also public -> https://gerrit.wikimedia.org/r/#/c/107125/
That route could be followed for the siteinfo as well.

Tgr added a comment.Jan 13 2014, 11:30 AM

(In reply to comment #1)

The siteinfo API returns all this (except for the favicon). So maybe we
should return a link to the API endpoint in the repoinfo (assuming there
is an API)?

Apparently this is returned already (friprop=apiurl).

Change 107127 merged by jenkins-bot:
Add $wgFavicon to siteinfo API

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

(In reply to comment #5)

You can use action=query&meta=filerepoinfo to get some information for file
repos.

I know. I wrote it. :)

Related patch has been merged; resetting status.

Tgr added a comment.Feb 11 2014, 7:09 PM

Mark, is there anything else we need or can this be closed? We do not have article path / namespace in the API response but we extract that information from descBaseUrl or something like that, IIRC.

Tgr removed Tgr as the assignee of this task.Jan 30 2015, 2:38 AM
Anomie moved this task from Unsorted to Needs Code on the MediaWiki-API board.Feb 19 2015, 6:46 PM