Last modified: 2013-02-13 12:22:18 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T38912, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 36912 - Provide an API that just outputs the count
Provide an API that just outputs the count
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
GlobalUsage (Other open bugs)
unspecified
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: 17993
  Show dependency treegraph
 
Reported: 2012-05-16 19:12 UTC by Rainer Rillke @commons.wikimedia
Modified: 2013-02-13 12:22 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Rainer Rillke @commons.wikimedia 2012-05-16 19:12:18 UTC
On Wikimedia Commons we have some scripts that only have to bother about the count of global usages, not where it is used. These main types are there:
* Script that request CommonsDelinker to replace files across wiki projects simply want to know: Used or not?
* The user-gallery-script could provide these information so the user gets an idea what kind of images are often used and what not
* A script that is assisting creating deletion requests could display this number so it is easier to find files not being in project scope (a file is in scope automatically if it is used in an other Wikimedia Project) and those you better don't touch

This is currently possible when querying a single file. But when it comes to multiple files, the global usage is limited to 500 entries in total, not per file.

Either a limit per file is introduced (I would set it to a low number for most tools) or something that returns the number is required.

Thank you.
Comment 1 Sam Reed (reedy) 2012-05-16 21:15:11 UTC
See also bug 17993

Can't you just limit the query to say 5 results, and if you get >= 1 result, you know it's used?
Comment 2 Rainer Rillke @commons.wikimedia 2012-05-20 09:39:11 UTC
If I would query each single file this would be Ok. But if I want to know whether 100 files are globally used, I don't want to send 100 requests.

Therefore I do it this way:
https://commons.wikimedia.org/w/api.php?action=query&prop=globalusage&titles=File:Example.jpg|File:Example.png&gulimit=5

The response does not give any results for File:Example.png, only for File:Example.jpg

Since the count is requested in bug 17993, perhaps this bug could suggest limiting the results per item (File in this case) when querying multiple titles because the same applies for categories and other stuff.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links