Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • E emalm-main
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • group-emalm
  • emalm-main
  • Merge requests
  • !6

Modernize app structure, migrations, admin tooling, and media workflows

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Onne Ronda requested to merge fix/misc into master Apr 28, 2026
  • Overview 0
  • Commits 4
  • Pipelines 0
  • Changes 219+

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_imports table for yt-dlp/source-import metadata
  • added comment soft-delete support
  • moved profile data directionally toward users instead of profils

Admin panel

  • switched admin auth to DB-backed users.priv = 1
  • removed the older config-based admin identity split
  • added/expanded:
    • Maintenance tab
    • Shaka tab
    • 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-dlp binary/path in the target environment
  • Shaka asset URLs and version are now config-driven

Verification run

Ran:

  • php tests/run.php
  • npm run test:js
  • php tests/admin_smoke_runner.php overview
  • php tests/admin_smoke_runner.php config
  • php tests/admin_smoke_runner.php maintenance
  • php tests/admin_smoke_runner.php database
  • php tests/admin_smoke_runner.php system
  • php tests/admin_smoke_runner.php shaka

Known gaps / honest notes

  • yt-dlp import plumbing is implemented, but this environment did not have yt-dlp available 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.hu sidecar/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:

  1. migrations / schema / admin auth
  2. admin panel + maintenance/config/shaka tabs
  3. upload/media pipeline and repository changes
  4. yt-dlp import plumbing
  5. frontend/mobile/upload/menu/settings JS work
  6. legacy wrapper cleanup / route consolidation
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: fix/misc