Template:DPLA duplicate

Template documentation[view · edit · history · purge]
This documentation is transcluded from Template:DPLA duplicate/doc.


Purpose

{{DPLA duplicate}} tags a file uploaded by DPLA bot that duplicates an existing Commons file, but throttles how many such files are presented to administrators at once.

Rather than adding every duplicate directly to Category:Duplicate (which would flood the speedy-deletion queue with tens of thousands of files), this template holds files in a private backlog — Category:DPLA duplicates for deletion — and releases them into Category:Duplicate a bounded number at a time, oldest first, as administrators clear the previous batch. The release is governed by a single "moving window" value at Template:DPLA duplicate/moving window, advanced automatically by a scheduled bot job. No per-file edits are made to reveal a file; the window edit plus an invisible re-parse moves a whole batch.

Usage

{{DPLA duplicate | 1 = CORRECT FILENAME | ts = SORTKEY | reason = OPTIONAL REASON }}
ParameterRequiredDescription
1yesThe correct filename this file duplicates (without

the File: prefix). Passed to {{Duplicate}} as 1= when the file is released. Pass it named (1=) so a filename containing = is handled safely.

tsyesThe sort key that determines release order. Must be

a fixed-width, zero-padded, strictly increasing integer (see below).

reasonnoFree-text reason, passed to

{{Duplicate}} as 2= and shown to administrators ("…for the following reason: …"). If omitted, the {{Duplicate}} banner still renders its complete target-only text.

The ts sort key

The ts value is used both as the category sort key (so the backlog sorts oldest-first) and as the quantity compared against the moving window. Because MediaWiki category sort keys are compared lexically, the value must be:

  • fixed width and zero-padded, so lexical order equals numeric
 order (e.g. always 20 digits), and
  • unique per file, so advancing the window by one step releases an exact
 count rather than a whole tied group.

The DPLA tagging job assigns ts = unix_seconds × 100000 + sequence, zero-padded to 20 digits, where sequence is a per-run counter. This preserves tagging order and guarantees uniqueness.

How release works

A file is released (visible in Category:Duplicate) when ts < the value at Template:DPLA duplicate/moving window:

  • Released — transcludes
 {{Duplicate|1=CORRECT FILENAME|2=reason}},
 adding Category:Duplicate with the target and reason, and the F8
 speedy-deletion request.
  • Not yet released — adds only the backlog category
 Category:DPLA duplicates for deletion.

The two states are mutually exclusive, so the backlog category always reflects work not yet surfaced to admins.

A tag with no ts fails closed: it is placed in the backlog without a sort key and is never released (the release job skips non-integer sort keys), so a malformed tag can never jump the queue.

The window starts at 0 (nothing released) and is only ever advanced by the dpla-dup-window scheduled job, which tops the visible count back up to its target (~100) as administrators delete released files. The window is monotonic — it never moves backward — so files never un-release.

To decide how many files to release, the job counts how many DPLA files are currently in Category:Duplicate by scanning that category (a few hundred members) and matching the - DPLA - token in the filename. This counts DPLA duplicates tagged by any route — both files released by this template and files tagged directly with {{Duplicate}} by the upload bot — so the two mechanisms share a single ~100-file budget rather than each filling it independently.

Do not edit Template:DPLA duplicate/moving window by hand.

See also

Category:Digital Public Library of America