|
|
@@ -4,35 +4,10 @@ import {
|
|
|
VideoStatsResponse,
|
|
|
} from '../services/video-stats.service';
|
|
|
|
|
|
-/**
|
|
|
- * Dev-only controller for video statistics.
|
|
|
- *
|
|
|
- * Routes:
|
|
|
- * - GET /api/v1/mgnt/dev/video/stats
|
|
|
- *
|
|
|
- * Returns video counts per category and per (category, tag) pair
|
|
|
- * using hardcoded IDs for testing purposes.
|
|
|
- *
|
|
|
- * ⚠️ DEVELOPMENT ONLY - Do not expose in production
|
|
|
- */
|
|
|
@Controller('dev/video')
|
|
|
export class VideoStatsController {
|
|
|
constructor(private readonly statsService: VideoStatsService) {}
|
|
|
|
|
|
- /**
|
|
|
- * GET /api/v1/mgnt/dev/video/stats
|
|
|
- *
|
|
|
- * Computes and returns video statistics for hardcoded categories and tags.
|
|
|
- * Uses videoMedia.count() with appropriate filters:
|
|
|
- * - Categories: listStatus: 1
|
|
|
- * - Tags: categoryId, tagId, listStatus: 1
|
|
|
- *
|
|
|
- * Query filters match builder logic for consistency:
|
|
|
- * - Only counts videos with listStatus: 1 (on shelf)
|
|
|
- * - For tags, also filters by tag membership: tagIds: { has: tagId }
|
|
|
- *
|
|
|
- * @returns VideoStatsResponse with category and tag video counts
|
|
|
- */
|
|
|
@Get('stats')
|
|
|
async stats(): Promise<VideoStatsResponse> {
|
|
|
return this.statsService.computeStats();
|