Resolved

YouTube series videos upload out of order breaking narrative flow

Python
asyncio
YouTube API
Video Processing
Queue System
Backend
File Handling
Upload Coordination

Async video rendering completion causes later series parts to upload before earlier ones | Python asyncio queue system fails to enforce sequential upload order for YouTube series content

Issue

Video series uploaded to YouTube in incorrect order due to asynchronous rendering completion times, causing later parts (e.g., part 3) to upload before earlier parts (e.g., part 2). This disrupted narrative flow for tutorial series, as viewers would encounter later content before prerequisite material. The issue arose because the system processed videos based solely on rendering completion without enforcing sequential upload order.

Culprit

The upload watcher logic lacked dependency checks to enforce sequential upload order. The system only verified if both MP4 files (horizontal + shorts) were ready for a video, but it did not check whether previous parts in the series had been uploaded. This allowed videos to enter the upload queue out of order, with later parts uploading first despite lower priority.

Solution

Implemented a blocking mechanism to enforce sequential upload order by:

  • Adding dependency checks to verify if previous parts in a series are ready before uploading the current part.
  • Inspecting the filesystem and pending queue for incomplete previous parts, blocking uploads until prerequisites are met.
  • Automatically unblocking videos when their predecessors complete, ensuring correct sequential upload order.

This transformation ensured that video series maintained chronological order, preserving narrative flow and improving the viewer experience.