-
Notifications
You must be signed in to change notification settings - Fork 24
Add web UI with Plex OAuth, dashboard, and consolidated documentation #134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
f36309c to
b974c48
Compare
|
@jonathan-vella wow, thank you! I will review this ASAP. |
|
Hey @jonathan-vella this is a large PR. I assume it was vibe coded? Not sure ill be able to review all of it but happy to do a quick one. + test and merge it in.. LMK when it's complete? Do you have any screenshots you can share? Also, it supports dockerfile right? (edit, nevermind i see it does) |
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (42.01%) is below the target coverage (65.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #134 +/- ##
===========================================
- Coverage 70.82% 55.69% -15.14%
===========================================
Files 11 18 +7
Lines 2314 3896 +1582
===========================================
+ Hits 1639 2170 +531
- Misses 675 1726 +1051
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Latest Update: Security Step Added to Setup WizardAdded a new Step 5 (Security) to the setup wizard that allows users to:
Changes in this commit:
User Experience:
All 295 tests passing. |
BTW. It's complete.
|
Tests & Documentation AddedAdded comprehensive test coverage and API documentation for the new Security step: Unit Tests (14 new)
E2E Tests (5 new)
Documentation
Test ResultsBefore: 295 tests → After: 314 tests (+19) |
|
@jonathan-vella is this ready? |
jonathan-vella
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary: Ready for Review ✅
All planned work is complete. Two critical fixes have been implemented:
1. ETA Stuck at "1s" Bug - FIXED
Root Cause: Two compounding issues prevented accurate ETA calculation:
progress_callbackonly fired on task completion (minutes apart) — during long FFmpeg runs, stale ETA was never recalculated- Sliding window approach treated fast-skipped items (existing BIF files) identically to real work, permanently inflating the rate
Solution:
- Burst detection algorithm (
routes.py): Classifies items by completion time (>2s = real work, <2s = skipped), measures rate only from real work, requires ≥10s of sustained processing before showing ETA - Periodic progress emission (
worker.py):on_poll()now callsprogress_callbackevery 3s to keep ETA fresh even during long FFmpeg processing
Files Modified:
plex_generate_previews/web/routes.py- Replaced sliding window with burst detectionplex_generate_previews/worker.py- Added 3s polling interval for progress updates
Expected Behavior After Deploy:
- ETA shows "Calculating..." during initial skip burst
- Transitions to realistic times once real FFmpeg work established
- Updates every 3 seconds instead of only on task completion
2. Additional Work Completed
- ETA calculation redesigned for accuracy
- All files validated — no lint/compile errors
- Ready for testing and merge
Status: ✅ READY FOR MERGE
Yes. It is. Tested for a week on Unraid. |
|
ok, please give me some time and ill get this reviewed as best i can, thanks! |
…tation Add a full-featured web interface for managing Plex preview generation: Web UI & Dashboard: - Setup wizard with 5-step guided configuration and Plex OAuth sign-in - Real-time dashboard with job progress, worker status cards, and log viewer - Settings page with live save to /config/settings.json - Multi-library selection, browser notifications, connection status display - Rate-limited auth endpoints (Flask-Limiter) and CSRF protection (Flask-WTF) Production Server: - gunicorn with gthread workers and simple-websocket for WebSocket support - Dedicated wsgi.py entry point; wrapper.sh launches gunicorn Security: - Path traversal protection with PLEX_DATA_ROOT/MEDIA_ROOT constraints - Secret file permissions, input sanitization, XSS prevention - Token-based authentication with @login_required / @api_token_required ETA Algorithm: - Dual-track ETA calculation (burst-filtered rate + simple elapsed fallback) - Stall detection suppresses misleading near-zero ETA when most items skip Testing & CI: - 530+ pytest tests covering auth, routes, settings, scheduler, workers, ETA - GitHub Actions workflow for ruff lint, pytest, and Docker image builds - Pre-commit hooks for ruff check + format Documentation & Tooling: - Consolidated docs: quickstart, configuration, GPU support, API, FAQ, web UI - Unraid Community Applications template with networking guidance - Windows dev bootstrap script (scripts/setup-windows-dev.ps1) - CONTRIBUTING.md with development setup and PR guidelines - CHANGELOG.md following Keep a Changelog format
|
@jonathan-vella will also support "scheduling" like a cron job? |


Summary
This PR adds a comprehensive web-based interface for managing preview generation, replacing the need for manual environment variable configuration.
Features
Web UI
Authentication
WEB_AUTH_TOKENstill works for Docker power usersProcessing Improvements
Documentation
Technical Details
set_auth_token(),get_token_info()APIs/config/settings.jsonScreenshots
The web UI provides:
Testing
Tested on Unraid with:
Files Changed
plex_generate_previews/web/moduledocs/consolidated documentationunraid-templates/for Unraid Community Apps