What do do
- Please restrict "Files in use" so that a file is "in use" only if it is placed on a main namespace page.
- Please update the on-screen metric glosses as follows (I've updated the Help page already):
- Avg. daily views to uploaded files: A 31-day average of daily pageviews to all main namespace pages on all wikis on which Uploaded files have been placed (compiled once per day). If fewer than 31 days are available, the average is calculated for the available days.
- Unique pages with uploaded files: A count of all non-duplicate main namespace pages, on all wikis, on which Files Uploaded have been placed.
- Uploaded files in use: A count of the Uploaded Files that have been placed on at least one main namespace page on any wiki.
What is the problem? (background)
"Files in use" appears to count files as being in use if they are used on non-mainspace pages.
For example, this event reports 6 files uploaded and 1 in use. However, of the 6 files, the only one in use is https://commons.wikimedia.org/wiki/File%3AReichstag_building_main_entrance_01.jpg which is used on a Wikipedia namespace page.
The getUsedFiles method in EventRepository.php does not include "gil_page_namespace_id = 0" or "il_from_namespace = 0", as other file metrics do.
Steps to reproduce problem
- Make an event which only includes the file upload for https://commons.wikimedia.org/wiki/File%3AReichstag_building_main_entrance_01.jpg
- Calculate metrics
Expected behavior: Reports 0 files in use
Observed behavior: Reports 1 file in use