unusedfiles.py tags orphan files, however on each run, it tags again the files even if they were tagged previously. Please prevent the bot from tagging the image again if already tagged. Thank you.
Description
Details
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
unusedfiles.py: do not tag image if already tagged | pywikibot/core | master | +25 -2 |
Event Timeline
MarcoAurelio : In unusedfiles.py there is code to check this. Can you elaborate more on this?
I'm afraid I don't know how to explain further. Please see https://meta.wikimedia.org/w/index.php?title=File:Head_logo.jpg&action=history for the issue (just one random file chosen, although they're more).
I've changed the template in my local repo, so it's not the same as in rPWBC, but it should still work.
@Anoopchandu18, the template is searched "as is" in text.
if self.template_image in image.text
Maybe better to construct a template page from 'self.template_image' and check if it is in image.templates()?
Change 313309 had a related patch set uploaded (by Mpaa):
unusedfiles.py: do not tag image if already tagged
I think it is insufficient to check for the template only. Looking at the file page I found an additional but still undocumented parameter for the template. I guess the bot script should be changed to tag this new parameter too.
@MarcoAurelio could you please explain the new parameter(s) you have added.
https://meta.wikimedia.org/w/index.php?title=Template:Orphan_file&action=history
decrease prio because this bug is caused by a modified script but the enhencement should be added.
My local PWB copy is already modified to tag with that new parameter.
It allows categorizing by date to allow better maintenance with a subst:#time.
OK, so different parameters to be added for different templates/sites?
It starts to get complicated.
I can't mentor this as im not familar with pywikibot but I believe this to be a good GCI task.
Given the previous comments in this task I'm removing both the good first task tag (T145853#2678357) and the Google-Code-in-2017 tag (no mentors).