Repository navigation
feat: add setting to skip the theme scan at startup - #693
Conversation
Themerr runs every scheduled job once when it starts, including the full theme scan. Setting THEMERR_SCAN_ON_BOOT=false (or 0/no/off) skips only that startup scan; the dashboard refresh still runs and scheduled scans continue at the configured interval. Unset keeps the current behaviour.
eaf491e to
34b2fcf
Compare
ReenigneArcher
left a comment
There was a problem hiding this comment.
Requesting changes for the configuration integration described inline: startup scanning should be a normal Themerr boolean setting, defaulting to True, with the scheduler reading config.CONFIG.
Reviewed head 34b2fcfeaf353c0bef6e3561e89f7e1034f1f201 against current master (6fcf177ee4fb5388f531fa89203aa012634447cc).
Validation: all 32 targeted scheduler/config tests passed; flake8 on both changed Python files and git diff --check HEAD^ HEAD passed. A separate mocked scheduler check confirmed that disabling startup scanning still dispatches dashboard/release jobs, preserves the scan's initial due time, and dispatches it when due.
Hosted Sonar and Read the Docs checks passed. CI and CodeQL require maintainer approval, so those results are unavailable. Local python -m dockle build stopped because Doxygen is unavailable. No live Docker/media-server validation was performed during this review.
Review completed by Codex | Model: gpt-6.1-sol | Thinking: xhigh
Replace the THEMERR_SCAN_ON_BOOT environment variable with the BOOL_SCAN_ON_BOOT setting (default on), so it appears on the Settings page and persists in config.ini. The scheduler reads it at startup.
ReenigneArcher
left a comment
There was a problem hiding this comment.
Re-reviewed 3cc471f797ff3192ce7935a316843719e64bfba6, including the follow-up since 34b2fcf and the complete PR diff. The original request to use persisted configuration is addressed: the setting defaults to enabled, appears through the existing Settings schema, and has config-reload coverage.
Two maintainer-requested cleanup changes remain, detailed inline:
- Revert
DOCKER_README.mdentirely. - Remove
scan_on_boot()and readconfig.CONFIG['Themerr']['BOOL_SCAN_ON_BOOT']directly inschedule_loop().
These are cleanup requests; I found no additional runtime defect.
Validation: all 25 focused scheduler/config tests passed; flake8 on all three changed Python files and git diff --check passed. A separate mocked scheduler check verified that disabling startup scanning preserves dashboard/release startup jobs and later scheduled scans. Latest master (1c47d32) only adds a Swagger UI dependency update since the PR base.
Hosted Sonar and Read the Docs checks passed. CI and CodeQL still require maintainer approval. The local documentation build stopped because Doxygen is unavailable. Validation covers the submitted head; the inline cleanup suggestions were not applied locally.
Review completed by Codex | Model: gpt-6.1-sol | Thinking: xhigh
Co-authored-by: Dave Lane <42013603+ReenigneArcher@users.noreply.github.com>
Co-authored-by: Dave Lane <42013603+ReenigneArcher@users.noreply.github.com>
Removed the scan_on_boot function that checks if the theme scan should run on startup.
ReenigneArcher
left a comment
There was a problem hiding this comment.
Re-reviewed b6775e1b77a97c4022fcd6a58a72cf919fddc1b8 against current master (94a43a1), including the changes since the last reviewed head 3cc471f and the complete PR diff.
The Docker README now matches the target branch, and the scheduler reads the config directly without a helper. One follow-up defect remains: two regression tests still call the deleted scan_on_boot() function.
The submitted head produced 2 failed, 23 passed across the scheduler/config tests. Both failures are AttributeError at the stale helper calls. The inline suggestion removes those calls while retaining the default/persistence assertions; all 25 tests passed when I verified that suggestion in the temporary review checkout, then restored the submitted file.
Flake8 and git diff --check passed. A separate mocked scheduler check confirmed that disabling the startup scan preserves dashboard/release startup jobs and later scheduled scans. Hosted Sonar and Read the Docs checks passed. CI and CodeQL await maintainer approval; the local documentation build remains blocked by missing Doxygen.
Review completed by Codex | Model: gpt-6.1-sol | Thinking: xhigh
oh fudge sake, that will teach me to use github suggestions Co-authored-by: Dave Lane <42013603+ReenigneArcher@users.noreply.github.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #693 +/- ##
==========================================
+ Coverage 89.13% 89.14% +0.01%
==========================================
Files 77 77
Lines 6368 6375 +7
Branches 904 907 +3
==========================================
+ Hits 5676 5683 +7
Misses 478 478
Partials 214 214
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|



Description
Adds a Scan on startup setting (
BOOL_SCAN_ON_BOOT, under Settings → Themerr) that lets administrators skip the theme scan when Themerr starts.When the scheduler starts,
schedule_loopruns every job once withschedule.run_all(). That includes the full "Theme scan and queue" job whenever theme updates are enabled. On a large library, or with frequent container restarts, this means a complete scan of every server on each boot.With this change:
config.inilike the other Themerr settings.Skipping the startup theme scan because Scan on startup is disabled. The dashboard refresh and the release check still run.INT_UPDATE_THEMES_INTERVALschedule.The scan job gets an extra
theme-scantag, next tothemerr, so the loop can find it.DOCKER_README.mdtells container users where to find the setting.Updated after review: this started as a
THEMERR_SCAN_ON_BOOTenvironment variable and is now a regular Themerr setting, as requested.Screenshot
Issues Fixed or Closed
Roadmap Issues
Testing
Tests in
tests/unit/themerr/test_scheduled_tasks.py:schedule_loopdispatches the dashboard refresh but not the theme scan, and the scan job stays scheduled for its next run.The existing
test_schedule_loopstill covers the defaultrun_all()path.pytest -o addopts='' -p no:cacheprovider(excludingtests/unit/test_notification_build.py, which needs PyInstaller locally): 1045 passed, 19 skippedflake8andgit diff --check: cleanpython scripts/localize.py --extract: adds "Scan on startup" and its description tolocale/themerr.popython -m dockle build, because the Dockle submodule and the C# doc toolchain aren't set up here.Manual (earlier env-var version): built a linux/amd64 image with the startup scan disabled and confirmed the container became healthy and logged the skip message, deployed in Docker against a real Plex and Jellyfin setup.
Type of Change
Checklist
AI Usage
See our AI usage policy.
Claude Code helped explore the scheduler, implement the change and review follow-ups, and build the test image. I reviewed the changes and tested them on my own server.