Skip to content
This repository has been archived by the owner on Nov 16, 2024. It is now read-only.

Commit

Permalink
added 3 new db reports
Browse files Browse the repository at this point in the history
  • Loading branch information
fastily committed Jan 23, 2024
1 parent e65bedc commit 0665a36
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fastilybot/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@ def _main():
r.orphaned_keep_local_with_commons_duplicate()
case 28:
r.confirmed_autoconfirmed_users()
case 29:
r.largest_orphaned_free_files_by_bytes()
case 30:
r.smallest_orphaned_free_files_by_bytes()
case 31:
r.smallest_orphaned_free_files_by_resolution()
case _:
log.warning("No such report id (%d), skipping", id)

Expand Down
12 changes: 12 additions & 0 deletions fastilybot/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ def large_user_talk_pages(self) -> None:
"""Reports unusually large user talk pages. Report 21"""
self._simple_update("Unusually large user talk pages", fetch_report(21, "User talk:"), False)

def largest_orphaned_free_files_by_bytes(self) -> None:
"""Reports largest orphaned free files by file size. Report 29"""
self._dump_file_report("Largest orphaned free files by bytes", 27)

def low_resolution_free_files(self) -> None:
"""Reports low resolution free files. Report 11"""
self._simple_update("Orphaned low-resolution free files", self._difference_of(10, "Category:Wikipedia images available as SVG", "Category:All files proposed for deletion"))
Expand Down Expand Up @@ -225,6 +229,14 @@ def shadows_commons_page(self) -> None:
"""Reports local files that shadow a commons file or redirect. Report 1"""
self._dump_no_redirect(subpage := "File description pages shadowing a Commons file or redirect", self._difference_of(11, self._ignore_of(subpage)))

def smallest_orphaned_free_files_by_bytes(self) -> None:
"""Reports smallest orphaned free files by file size. Report 30"""
self._dump_file_report("Smallest orphaned free files by bytes", 28)

def smallest_orphaned_free_files_by_resolution(self) -> None:
"""Reports smallest orphaned free files by resolution. Report 31"""
self._dump_file_report("Smallest orphaned free files by resolution", 29)

def transcluded_non_existent_templates(self) -> None:
"""Reports non-existent templates that have transclusions. Report 18"""
self._simple_update("Transclusions of non-existent templates", sorted([f"Special:WhatLinksHere/{s}" for s in fetch_report(14, "Template:")]), False)
Expand Down

0 comments on commit 0665a36

Please sign in to comment.