Documentation
¶
Overview ¶
Package uploads is for the one-off validation / queue processing which only applies to issues which aren't yet in the workflow. e.g., verifying that scanned issues have PDFs and TIFFs for each page, reporting pre-process-specific errors when trying to bring an issue into NCA's workflow, etc.
The package is meant to be usable from the web as well as command-line tasks as a way to ensure consistency when processing uploaded issues.
Index ¶
Constants ¶
const DaysIssueConsideredDangerous = 2
DaysIssueConsideredDangerous is how long we require an issue to be untouched prior to anybody queueing it
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
File wraps a schema file to add upload-specific validations
func (*File) ValidateDPI ¶
ValidateDPI adds errors to the file if its embedded images' DPIs are not within 15% of the expected value. This does nothing if the file isn't a pdf.
type Issue ¶
Issue wraps a schema.Issue to add upload- and queue-specific validations and behavior
func New ¶
New returns an Issue ready for validation checks and queueing. It requires a Scanner for checking dupes as well as global configuration in order to know scanned-issue DPI and born-digital MARC organization code.
func (*Issue) ValidateAll ¶
func (i *Issue) ValidateAll()
ValidateAll runs through all upload-queue-specific validations and adds errors which are only relevant to these issues. This validator runs the DPI check and is therefore fairly slow for scanned uploads. It shouldn't be run in bulk across a large number of issues.
func (*Issue) ValidateFast ¶
func (i *Issue) ValidateFast()
ValidateFast runs all the upload-queue-specific validations except those which are slow (namely the DPI check). This should be run against every issue being considered for queue.