Downloads official instruction PDFs from LEGO, located via the Brickset API, one set per interval (10 minutes by default) so neither API gets hammered. Official sets only; MOCs are excluded throughout. - New admin page at /admin/instruction-fetch: queue builder, pacing controls, live countdown and per-set job history - Database-backed queue (instruction_fetch_jobs) and last-run timestamp, so pacing survives restarts - Background worker thread, plus 'flask instructions queue/run/status' for Task Scheduler or cron - SHA-256 dedupe (instructions.sha256), PDF header check, size cap and streaming downloads via temp files - brickset_api: getInstructions2 by set number and getInstructions by setID (the old code sent a set number to the setID method); getSets params now proper JSON; getKeyUsageStats added - Schema top-ups applied automatically at boot: new table plus instructions.sha256/source - Docker: fetcher env vars passed through compose, no worker thread in the entrypoint bootstrap
11 lines
422 B
Python
11 lines
422 B
Python
from app.models.user import User
|
|
from app.models.set import Set
|
|
from app.models.instruction import Instruction
|
|
from app.models.extra_file import ExtraFile
|
|
from app.models.set_share import SetShare
|
|
from app.models.site_setting import SiteSetting
|
|
from app.models.instruction_fetch import InstructionFetchJob
|
|
|
|
__all__ = ['User', 'Set', 'Instruction', 'ExtraFile', 'SetShare',
|
|
'SiteSetting', 'InstructionFetchJob']
|