112 lines
6.1 KiB
JSON
112 lines
6.1 KiB
JSON
{
|
|
"master": {
|
|
"tasks": [
|
|
{
|
|
"id": 1,
|
|
"title": "Implement automatic YouTube thumbnail population for Directus media collection system",
|
|
"description": "Automatically extract YouTube video IDs from URLs and populate thumbnail URLs in the media_youtube_details collection, including fallback logic for different resolutions and optional local storage of thumbnails.",
|
|
"status": "done",
|
|
"priority": "medium",
|
|
"dependencies": [],
|
|
"details": "This task involves integrating logic to parse YouTube URLs, extract video IDs, and fetch thumbnails from YouTube's API. The implementation should include fallback logic for different thumbnail resolutions (e.g., default, medium, high). Additionally, the system should support optional local storage of thumbnails for performance and reliability.",
|
|
"testStrategy": "Verify that the system correctly extracts video IDs from YouTube URLs. Ensure that the thumbnail URL is populated in the media_youtube_details collection. Test fallback logic by simulating different resolution preferences and ensuring the correct thumbnail is selected.",
|
|
"subtasks": [
|
|
{
|
|
"id": 1,
|
|
"title": "Implement YouTube URL parser for video ID extraction",
|
|
"description": "Create a robust module to extract video IDs from all YouTube URL formats (standard, short, embedded, timestamps)",
|
|
"status": "done",
|
|
"dependencies": [],
|
|
"details": "Use URL parsing functions (like parse_url and parse_str) to isolate video IDs from query parameters or path segments. Handle edge cases like URLs with additional parameters, timestamps, or playlist references. Validate extracted IDs against YouTube's 11-character pattern."
|
|
},
|
|
{
|
|
"id": 2,
|
|
"title": "Design configuration system for thumbnail resolution preferences",
|
|
"description": "Implement configurable resolution hierarchy and API settings management",
|
|
"status": "done",
|
|
"dependencies": [],
|
|
"details": "Create configuration schema for resolution priority order (e.g. ['maxres', 'high', 'medium', 'default']), YouTube API key storage, and local storage toggle. Use environment variables for sensitive data with fallback defaults."
|
|
},
|
|
{
|
|
"id": 3,
|
|
"title": "Implement YouTube Data API client with error resilience",
|
|
"description": "Build authenticated API client with rate limit handling and retry mechanisms",
|
|
"status": "done",
|
|
"dependencies": [
|
|
"1.1",
|
|
"1.2"
|
|
],
|
|
"details": "Use Axios/Fetch to call YouTube's videos.list endpoint. Implement exponential backoff for 429 errors, circuit breakers for service outages, and graceful degradation. Cache API responses temporarily to reduce quota consumption."
|
|
},
|
|
{
|
|
"id": 4,
|
|
"title": "Develop thumbnail resolution fallback logic",
|
|
"description": "Create resolution selection algorithm with quality prioritization",
|
|
"status": "done",
|
|
"dependencies": [
|
|
"1.3"
|
|
],
|
|
"details": "Parse API response thumbnails object to select highest available resolution per configuration hierarchy. Implement validation for image dimensions and HTTP status. Fallback to lower resolutions when higher ones are missing or invalid."
|
|
},
|
|
{
|
|
"id": 5,
|
|
"title": "Implement local thumbnail storage service",
|
|
"description": "Create caching mechanism for thumbnail persistence with TTL management",
|
|
"status": "done",
|
|
"dependencies": [
|
|
"1.2",
|
|
"1.4"
|
|
],
|
|
"details": "Develop service to store thumbnails in configurable directory using video ID as filename. Implement TTL-based cache invalidation, disk space monitoring, and on-demand regeneration. Use sharp/ImageMagick for format conversion if needed."
|
|
},
|
|
{
|
|
"id": 6,
|
|
"title": "Integrate thumbnail service with Directus media collection",
|
|
"description": "Build Directus hook to auto-populate thumbnail fields from YouTube URLs",
|
|
"status": "done",
|
|
"dependencies": [
|
|
"1.4",
|
|
"1.5"
|
|
],
|
|
"details": "Create Directus action handler triggered on media_youtube_details creation/update. Extract video ID from source URL, fetch thumbnail via unified service (API + cache), and populate thumbnail_url field."
|
|
},
|
|
{
|
|
"id": 7,
|
|
"title": "Implement fallback mechanism for API unavailability",
|
|
"description": "Create secondary thumbnail source when YouTube API is inaccessible",
|
|
"status": "done",
|
|
"dependencies": [
|
|
"1.1",
|
|
"1.4"
|
|
],
|
|
"details": "Develop logic to generate thumbnail URLs using YouTube's static pattern (https://img.youtube.com/vi/{id}/{resolution}.jpg) when API fails. Validate image existence via HEAD requests."
|
|
},
|
|
{
|
|
"id": 8,
|
|
"title": "Develop comprehensive test suite and validation pipeline",
|
|
"description": "Create automated tests covering all integration points and failure scenarios",
|
|
"status": "done",
|
|
"dependencies": [
|
|
"1.1",
|
|
"1.2",
|
|
"1.3",
|
|
"1.4",
|
|
"1.5",
|
|
"1.6",
|
|
"1.7"
|
|
],
|
|
"details": "Build unit tests for URL parsing and resolution logic. Create integration tests for API/cache interactions. Implement E2E tests simulating Directus workflows. Include performance tests for bulk operations and quota usage monitoring."
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"metadata": {
|
|
"version": "1.0.0",
|
|
"createdAt": "2025-01-11T00:00:00Z",
|
|
"lastUpdated": "2025-01-11T00:00:00Z",
|
|
"created": "2025-08-11T08:07:11.464Z",
|
|
"description": "Tasks for master context",
|
|
"updated": "2025-08-11T08:07:11.466Z"
|
|
}
|
|
}
|
|
} |