mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-01 10:22:25 +00:00
refactor(ai): extract ModerationDecorator from js/app.js (agent)
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.
This commit is contained in:
1 parent
c98f2cd720
commit
8015edf6b3
4 files changed
+696
-465
No files matched your search
Regular → Executable
File mode changed.
Reference in new issue
Block a user