User talk:Lucas Werkmeister/QuickCategories

Add topic
From Meta, a Wikimedia project coordination wiki

pending commands[edit]

@Ash Crow and Strakhov: I’ve just reset some commands in batches of yours which were stuck in the “pending” state (should be run soon, but for some reason – most likely a bug in the tool – it never happened) to the default “planned” state. Specifically, these ones:

You might want to run some of these commands again to make sure they’re properly settled – hopefully they’ll work correctly now. Sorry for the inconvenience. --Lucas Werkmeister (talk) 11:32, 1 May 2019 (UTC)Reply

Thanks! I'll give it a look! Strakhov (talk) 11:36, 1 May 2019 (UTC)Reply
Hi, those batches were mostly each time the previous one without the blocking line (which I treated by hand then, which permitted me to see that the problem was protected categories), so running them again is useless. -Ash Crow (talk) 07:01, 2 May 2019 (UTC)Reply

Feature request[edit]

Hey Lucas, thank you for this awesome tool! I do have an idea, how to make it even more useful but no clue how easy or hard it would be to implement this. Since batch category jobs are quite often created with PetScan, would it be possible create a batch here using a PagePile id? That would make life so much easier. What do you think, feasible? Cheers, --MB-one (talk) 12:11, 18 May 2019 (UTC)Reply

@MB-one: I assume you mean the actions would be the same for each page? That should be possible, though I’m not very familiar with the PagePile system – do you perhaps have an example link or something? --Lucas Werkmeister (talk) 11:34, 26 May 2019 (UTC)Reply
Yes, the action would have to be the same for each page/file/category. Unfortunately, I can't provide much information on the inner workings of PagePile either. You can find example page piles at https://tools.wmflabs.org/pagepile/?menu=recent.
Cheers --MB-one (talk) 19:34, 26 May 2019 (UTC)Reply
@MB-one: This is now available at toolforge:quickcategories/batch/new/pagepile, please try it out! I’ll send a pull request to Magnus to add a link from the PagePile tool as well. --Lucas Werkmeister (talk) 12:05, 1 June 2019 (UTC)Reply
Works great. Thank you! --MB-one (talk) 13:51, 1 June 2019 (UTC)Reply

No sort key support[edit]

This would actually be the most interesting part for me. I can query the database for possibly wrong/missing sort keys, choose new ones based on some pattern matching but I haven't got a tool to replace them. So I'm looking forward to support for this. --Matěj Suchánek (talk) 16:25, 23 May 2019 (UTC)Reply

@Matěj Suchánek: thanks, that’s good to know! I’ve had sort key support on my to-do list for a while, but thought it wouldn’t be a very useful feature and therefore not a high priority. It’ll probably be at least a few more days before I have the time to work on it, but I can already show you what I’ve planned:
+Category:Cat#sort key
add with this sort key but only if no category link present
+Category:Cat##sort key
add with this sort key, or add sort key to existing category link if it doesn’t have one
+Category:cat###sort key
add with this sort key, or add/replace sort key of existing category link
-Category:cat#sort key
remove category link but only if it has this sort key
What do you think? I figured that the ## case would probably be the most common one (assuming that, if there already is a sort key, it might be better than what the user would add), but it sounds like you would use the ### case instead. --Lucas Werkmeister (talk) 11:29, 26 May 2019 (UTC)Reply
Thanks for your reply. It looks great to me and I like that the user will need to explicitly specify the prerequisites. Unless I'm missing something, there should be also a possibility to remove just the sort key and leave the category with the default one.
In fact, I'm more likely to use ##. --Matěj Suchánek (talk) 12:29, 26 May 2019 (UTC)Reply
To remove the sort key, you’d use ### without a sort key behind it (i. e. with an empty sort key). I’ll make sure the tool does the right thing in that case (i. e. not [[Category:Foo|]], because I have no idea what the pipe trick does to category links.) --Lucas Werkmeister (talk) 21:42, 27 May 2019 (UTC)Reply
@Matěj Suchánek: Sort key support is available now! --Lucas Werkmeister (talk) 22:31, 30 May 2019 (UTC)Reply
Very nice, thank you! I'm currently too busy to start testing and using it but I promise I will provide you with soem feedback soon. --Matěj Suchánek (talk) 15:39, 2 June 2019 (UTC)Reply

wiki read-only[edit]

Hi @Lucas Werkmeister:, first of all, thanks for this awesome tool! I was for some time looking for something similar and was glad to find QuickCategories. Unfortunately, I caused some trouble. One status of the tasks of my job #393 was "wiki read-only", which seemed to have stopped the whole batch job. At the moment I'm not able to see which of the categories is actually affected as:

  • going to page two of the tasks causes an internal server error
  • changing the limit as per url parameter doesn't seem to be possible.

Can you help me with that? Thanks a lot, --Tomukas (talk) 16:15, 8 August 2019 (UTC)Reply

@Tomukas: Thanks for the bug report! I’ve fixed the issue when viewing the second page – it was display-only, and the tool automatically resumed the batch after half an hour and retried the failed command (that’s why it now shows 101 commands instead of 100), so there’s nothing more you need to do :) --Lucas Werkmeister (talk) 17:43, 8 August 2019 (UTC)Reply

Solving redirects[edit]

Hello @Lucas Werkmeister:! As we talked yesterday, it would be interesting to have a method to solve redirect, so we can add categories to the actual article or to the redirection. Thanks! -Theklan (talk) 08:38, 3 January 2020 (UTC)Reply

@Theklan: So in the Telegram discussion, our idea was to make this a per-page option, so that you could decide for each command (page + actions) whether a redirect should be resolved or not. But I’ve looked a bit into how the API deals with redirects now, and it looks like this would be easier to implement if it’s an option for the entire batch: either all the commands in a batch resolve redirects, or none of them do. Do you think that would also work? (I suspect that would be easier to use, too – a separate checkbox with a helpful label, rather than some more ASCII syntax in the input field.) --Lucas Werkmeister (talk) 22:05, 20 January 2020 (UTC)Reply
I think it should work, yes. -Theklan (talk) 22:24, 20 January 2020 (UTC)Reply
@Theklan: So it took me a bit longer, but this is implemented now. I went for the original idea after all (! before a title) – making the flag per-batch didn’t simplify the code as much as I’d thought, and I didn’t like the reduced flexibility. --Lucas Werkmeister (talk) 15:19, 16 February 2020 (UTC)Reply
Great! I'll solve some redirects soon and I will write you if I find any problem (but I don't expect to find anything!). -Theklan (talk) 15:52, 17 February 2020 (UTC)Reply

Sortkeys[edit]

Any way to keep sortkeys when removing a category and adding another? In this batch, I'd rather had the sortkey preserved when moving to the subcategory. 𝟙𝟤𝟯𝟺𝐪𝑤𝒆𝓇𝟷𝟮𝟥𝟜𝓺𝔴𝕖𝖗𝟰 (𝗍𝗮𝘭𝙠) 11:05, 25 January 2021 (UTC)Reply

"Removal all" command[edit]

This might be a bit niche or out of scope for this tool, but it would be very helpful to be able to specify a command to remove all categories, followed by several additions. For example (assuming asterisks aren't allowed in category names): -Category:*|+Category:Very cute cats. The specific use case I'm thinking of is when clearly out frequently diffused categories that are sometimes filled with lots of low-quality logos. They're often tagging with stuff like "Technology", "Science", "Innovative" and so on, so it's not possible to move them to a new category in one go with Cat-a-lot.

Hopefully that makes sense, and thank you for making such a great tool. :) Perryprog (talk) 23:34, 21 February 2021 (UTC)Reply

I'm pretty sure asterisks are allowed in category names, but "|-*" would solve this problem. 𝟙𝟤𝟯𝟺𝐪𝑤𝒆𝓇𝟷𝟮𝟥𝟜𝓺𝔴𝕖𝖗𝟰 (𝗍𝗮𝘭𝙠) 23:36, 21 February 2021 (UTC)Reply
Another thing I just realized: in a perfectly ideal world, being able to remove all categories that do or don't match a regex (or just a string), and then adding additional ones from there would be really great. Obviously that's much more difficult (time wise) to implement. Perryprog (talk) 23:57, 21 February 2021 (UTC)Reply
And for what it's worth, this isn't totally undoable with VisualFileChange—I just made a profile (source here) that seems to do OK with some over-the-top regex replacements. Perryprog (talk) 00:31, 22 February 2021 (UTC)Reply

Fails on Telugu wikipedia[edit]

@User:Lucas Werkmeister,batch did not work. Can you help?--Arjunaraoc (talk) 05:55, 4 January 2022 (UTC)Reply

@Arjunaraoc As far as I can tell, you created the batch but never ran it – make sure to press one of the buttons at the bottom (either run the commands on the current page, or run the whole batch in the background). Lucas Werkmeister (talk) 12:14, 4 January 2022 (UTC)Reply
@Lucas Werkmeister Thanks for your quick response. I tried running in background and it worked. Sorry to have bothered you. Arjunaraoc (talk) 13:05, 4 January 2022 (UTC)Reply

Earlier batches in a series of batches did not run[edit]

@User:Lucas Werkmeister I submitted several batches one after another and found only the last batch executed, even after waiting for 7 hours. If a queued feature is supported, it will be helpful. last batch which was run successfully. Earlier batch which did not run, but status says 'done'.--Arjunaraoc (talk) 00:42, 5 January 2022 (UTC)Reply

@Arjunaraoc When the status says “done”, but in teal instead of green, it means that no edit was necessary: in the case of batch #4217, which removes categories, that means the target page wasn’t in the category to begin with, as far as the tool could tell at least. (The tool can’t change categories added via templates, and doesn’t take subcategories into account: it only edits category links directly on the page.) The “done” badge for an individual edit also links to the permalink of the page as the tool saw it: for example, te:Category:అనంతసాగరం మండలంలోని గ్రామాలు, as of te:Special:PermanentLink/2241797, wasn’t in te:Category:శ్రీ పొట్టి శ్రీరాములు నెల్లూరు జిల్లా మండలాలు‎, and as far as I can tell from looking at the category’s source code myself, that’s correct. So the batch did run, there just wasn’t anything to do as far as the tool could tell. Lucas Werkmeister (talk) 01:33, 5 January 2022 (UTC)Reply
@Lucas Werkmeister, Ok. I might have made a mistake. If there is real change, it would be good to flag it. I I will try series of batches again and report if there is problem. Arjunaraoc (talk) 01:38, 5 January 2022 (UTC)Reply

Trimming category names[edit]

@Lucas Werkmeister, I have one feature request for the tool: it should be able to trim the category name when removing, e.g. Also remove Category:_Bla when asked to remove Category:Bla. MediaWiki already handles the 2 identically and some users consider it mode readable to leave a space after the namespace. Strainu (talk) 09:10, 27 December 2023 (UTC)Reply

@Strainu: I wasn’t aware of that, thanks! It should recognize such category links when adding or removing categories now. (But newly added categories should still be added as the user specified them, except that spaces will be replaced with underscores. I hope that makes sense.) Lucas Werkmeister (talk) 13:47, 28 December 2023 (UTC)Reply
Confirmed working, thanks a lot for the quick implementation! Strainu (talk) 16:51, 28 December 2023 (UTC)Reply