Summary
This is a large modernization pass across the app, database, admin tooling, media workflows, and frontend behavior.
It is not a narrow feature branch. In practice this MR:
- finishes a broad move toward the newer
app/structure - removes a lot of legacy root-level duplication and wrapper logic
- introduces real DB migrations/versioning
- adds maintenance/admin tooling for schema and media operations
- refactors upload/media behavior into shared helpers/services
- expands JS/UI behavior on mobile, upload, settings, profile, users, and menu flows
- adds Shaka configuration/admin controls
- adds the first end-to-end backend plumbing for admin-only yt-dlp video URL imports
Major changes
App structure / legacy cleanup
- moved more behavior behind the newer
app/route/controller/lib layout - thinned legacy entrypoints and kept compatibility wrappers where needed
- removed a large amount of older duplicated inline/root-level behavior
- consolidated more shared logic into library helpers and service-style modules
Database versioning and schema work
- added real database migration infrastructure and app version tracking
- added migration status/apply tooling and admin visibility for migration history
- introduced schema changes through migrations instead of ad hoc DB drift
- normalized the live schema toward
utf8mb4 - added index migrations for common query patterns
- added a
video_importstable for yt-dlp/source-import metadata - added comment soft-delete support
- moved profile data directionally toward
usersinstead ofprofils
Admin panel
- switched admin auth to DB-backed
users.priv = 1 - removed the older config-based admin identity split
- added/expanded:
-
Maintenancetab -
Shakatab - migration history visibility
- DB backup download
- bulk thumbnail regeneration
- video metadata backfill controls
- config editing improvements
-
- reordered and cleaned parts of the admin navigation and config experience
Media / upload / lifecycle
- refactored upload logic toward shared pipeline/repository helpers
- unified more of image/video processing and metadata persistence
- added shared media path/lifecycle handling for more routes
- added video metadata upsert behavior and admin refresh/backfill paths
- added admin-only yt-dlp import plumbing on the video upload page:
- format probe
- video/audio stream selection
- staged temp download
- handoff into the existing upload pipeline
- persistence of source/import metadata in
video_imports
Player / Shaka
- kept Shaka rather than switching players
- moved Shaka asset URLs/version into config
- added a dedicated admin surface for Shaka settings
- switched the player wrapper to a local script while keeping Shaka assets configurable by URL
Frontend / JS / mobile
- modernized the mobile media list flow
- added mobile auto-detection for routes that already had mobile views
- improved upload UX:
- file removal
- reorder before upload
- paste-from-clipboard for images
- unload warning during active upload
- richer success states
- improved viewer UX:
- overlay close behavior
- copy-link toast
- video keyboard shortcuts
- improved settings/profile/users/menu JS behavior
- added a JS test harness and coverage for the newer frontend modules
Migrations included
This MR includes the migration chain up through:
- comments soft delete
- video metadata schema work
- users/profils backfill direction
- common index additions
- schema migration metadata sync
video_imports- utf8mb4 normalization
Config / environment notes
- includes
config.local.php - does not include
config.dev.php - yt-dlp import is feature-gated and disabled by default
- yt-dlp import also depends on a working
yt-dlpbinary/path in the target environment - Shaka asset URLs and version are now config-driven
Verification run
Ran:
php tests/run.phpnpm run test:jsphp tests/admin_smoke_runner.php overviewphp tests/admin_smoke_runner.php configphp tests/admin_smoke_runner.php maintenancephp tests/admin_smoke_runner.php databasephp tests/admin_smoke_runner.php systemphp tests/admin_smoke_runner.php shaka
Known gaps / honest notes
- yt-dlp import plumbing is implemented, but this environment did not have
yt-dlpavailable on PATH, so a real live import against YouTube was not exercised here - non-English locale files were not fully hand-translated for every new string; English fallback covers the new keys
- the older
animehu.husidecar/orphan endpoints were intentionally left alone - this is a broad refactor, so review should assume meaningful risk even though tests are green
- mobile UI still deserves a dedicated real-browser QA pass, especially around the custom mobile shell/drawer behavior
Reviewer notes
This MR is easiest to review by subsystem, not file-by-file in raw diff order:
- migrations / schema / admin auth
- admin panel + maintenance/config/shaka tabs
- upload/media pipeline and repository changes
- yt-dlp import plumbing
- frontend/mobile/upload/menu/settings JS work
- legacy wrapper cleanup / route consolidation