Page MenuHomePhabricator

[L] Switch unique identifiers from file id to file name to for potential use of MediaSearch on non SD wikis
Closed, ResolvedPublic

Description

Non-commons wiki's utilise images stored both locally and stored in a shared repository (Commons). Media search will show both local and commons files both using search box and using url string

The imageinfo results differ from commons than on other wikis. Shared respository files not have "page id's" nor any unique identifier (bar file name) and I think this is what breaks QuickView.

Shared files pseudo exist locally. So the API locally is pulling in both local and shared files through the same request and are identified with

"imagerepository": "shared"

Options are:

  • Make tweaks to extmetadata to surface shared repository pageid's.
  • Surface concept URI
  • Switch to using file names. Some complexity in terms of ease of use in that the page title namespace prefix is localised.

Criteria for determining the best approach:

  • Would enable effective use of quickview planel for both local and shared images on non repository wiki's.
  • Potential impacts to other uses of extmetadata identified and mitigations proposed (namely MultimediaViewer)

Expected outcome of this ticket:

  • Determine what the best approach is, and document why it's the best approach and pros/cons
  • Create a new ticket to implement that approach
  • Have an understanding of when an image is not from Commons, what data we do and don't have

Event Timeline

Seddon renamed this task from How to request quickview data for cross-wiki files? to [SPIKE] How to request quickview data for cross-wiki files?.Aug 5 2021, 9:43 AM

Change 719764 had a related patch set uploaded (by Seddon; author: Seddon):

[mediawiki/extensions/MediaSearch@master] WIP Quickview data for non-commons wikis

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

The patch is just a WIP, there is a still that needs doing.

Most notable thing is that commons search is noticeably better than when done locally. Are we able to leverage the meadiasearch search profiles on other wikis? definitely a discussion to be had about the role mediasearch should play both now and the future.

Decisions needed:

  • Should we only provide commons search? This would mean not being able to search locally hosted images such as fair use.
  • Assuming we do want to include local files: Do we want to be able to toggle between commons and local+commons with the commons only as default? Do we want to have local search (which has local and commons files mixed) as default?

Work involved

  • Decide whether to move to using filenames as keys throughout MediaSearch? Or only use filenames when M-ids are unavailable?
  • Ensure that when all results are received from the api, we set the object id for each result to be the filename (maybe only when M-id isn't available?)
  • Potentially ensure that functions can handle string id's (or string and integer id's)
  • Ability for users to toggle between local+commons and commons only?

Question (potentially for a spike)

  • Is there any ability to filter out commons files when searching locally to only show local files?

Testing

  • Quick view can be opened, closed and changed for results sourced from both php and vue;
  • Also works for results that are the result of a "continue" for the same search result.
  • Successfully works when starting a new search within vue.
    • Does this for both for commons and for local wiki files
  • Works for images and video
  • No impact to other result types or search.
Seddon renamed this task from [SPIKE] How to request quickview data for cross-wiki files? to [L] How to request quickview data for cross-wiki files?.Sep 20 2021, 10:30 AM
Seddon renamed this task from [L] How to request quickview data for cross-wiki files? to [L] Switch unique identifiers from file id to file name to facilitate potential use of MediaSearch on wiki's without structure data.Oct 12 2021, 2:01 PM
Seddon renamed this task from [L] Switch unique identifiers from file id to file name to facilitate potential use of MediaSearch on wiki's without structure data to [L] Switch unique identifiers from file id to file name to for potential use of MediaSearch on non SD wikis.Oct 12 2021, 2:04 PM

Change 737638 had a related patch set uploaded (by Simone Cuomo; author: Simone Cuomo):

[mediawiki/extensions/MediaSearch@master] Quickview data for non-commons wikis

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

Change 719764 abandoned by Seddon:

[mediawiki/extensions/MediaSearch@master] WIP Quickview data for non-commons wikis

Reason:

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

Code Review regression check:

  • Mediasearch loads (Vue) - No regression observed. No console errors
  • No search, change tab - No regression observed. No console errors
  • Open filters - No regression observed. No console errors
  • Search via mediasearch search bar - No regression observed. No console errors
  • Search result scroll - Issue observed -
    • both load more and "invalid search" ) present.
    • Unable to scroll more results more than once (despite 9,032 results)
    • No console errors
    • Also in production. Not a patch related regression. Task filed T295630
  • Open quickview - No major regression observed. No console errors.
  • quickview - Navigate left and right - No major regression observed. No console errors.
  • quickview - fileinfo - No major regression observed. No console errors.
  • quickview - close - No major regression observed. No console errors.
  • Filters (Image) - No major regression observed. No console errors.
  • Filters (Audio) - No major regression observed. No console errors.
  • Filters (Video) - No major regression observed. No console errors.
  • Filters (Other) - No major regression observed. No console errors.
  • Filters (Pages) - No major regression observed. No console errors.
  • New search term - No major regression observed. No console errors.
  • Search via URI with filters - No major regression observed. No console errors.

Code review result:

On hold pending T295630

Change 737638 merged by jenkins-bot:

[mediawiki/extensions/MediaSearch@master] Quickview data for non-commons wikis

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