mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
Extracts `decorateVideoModeration` and related helper methods from `js/app.js` into a new `js/services/moderationDecorator.js` service. This improves separation of concerns by moving complex moderation logic out of the main application class. AGENTS.md Checklist: 1. Identify Logic: Extracted `decorateVideoModeration`, `deriveModerationReportType`, `deriveModerationTrustedCount`, `getReporterDisplayName`, `normalizeModerationSettings`, `getActiveModerationThresholds`. 2. Create Controller Method: Created `ModerationDecorator` class with `decorateVideo` method. 3. Create `bitvidApp` Wrapper: Replaced `decorateVideoModeration` in `js/app.js` with a wrapper that delegates to `this.moderationDecorator.decorateVideo`. 4. Wire Up Callbacks: Passed `getProfileCacheEntry` to `ModerationDecorator` constructor. 5. Remove Old Code: Removed extracted methods from `js/app.js`. Also added unit tests for `ModerationDecorator` and ensured runtime settings updates are propagated.