User:AnomieBOT/source/tasks/CommonsFileTemplateFixer.pm: Difference between revisions

Content deleted Content added
AnomieBOT (talk | contribs)
Updating published sources: CommonsFileTemplateFixer: * Add "starting run"/"continuing run" log entries to verify that the bot isn't hung.
AnomieBOT (talk | contribs)
Updating published sources: CommonsFileTemplateFixer: * Handle the possibility of too many categories to query with the edit token. AnomieBOT::API: * Fix adding of the xxlimit parameter for stuff queried with the edit token. Apparently this was broken since 2017, sigh.
 
Line 201:
keys %goodcopycats,
);
my $qcatlimit = $api->paramLimit( 'query+categories', 'categories' );
 
if ( ! $self->{'iter'} ) {
Line 241 ⟶ 242:
next if ( $self->{'iter'}->iterval eq $r{'Template:Copy to Wikimedia Commons'} && ( $api->store->{"copyCheckTs:$title"} // 0 ) ge $copyCheckTs );
 
my $tok=$api->edittoken( $title, EditRedir => 1, duplicatefiles => 1, categories => ( @qcats > $qcatlimit ? 1 : { categories => join( '|', @qcats ) } ) );
if ( $tok->{'code'} eq 'shutoff' ) {
$api->warn( "Task disabled: " . $tok->{'content'} . "\n" );