Skip to content

fix(youtube): resume from last posted video after interrupted batch#111

Merged
ChiefGyk3D merged 1 commit into
mainfrom
fix/youtube-state-resume-on-interrupt
Jul 14, 2026
Merged

fix(youtube): resume from last posted video after interrupted batch#111
ChiefGyk3D merged 1 commit into
mainfrom
fix/youtube-state-resume-on-interrupt

Conversation

@ChiefGyk3D

Copy link
Copy Markdown
Owner

Problem

check_for_new_videos() advanced and persisted last_video_id to the newest video before the daemon actually posted the batch to social platforms. If the process was killed mid-batch (e.g. a container restart or power event), every not-yet-posted video was silently marked as "seen" and never posted.

This is what caused the recent case where 8 new videos were detected but only the first posted after repeated restarts — the remaining videos (and a subsequent upload) were skipped with no error and no log line.

Fix

  • check_for_new_videos() no longer advances last_video_id up front.
  • Added mark_posted(video_data) on YouTubeVideosPlatform, which advances and persists last_video_id for a single video.
  • main.py's check_platforms() calls platform.mark_posted(video_data) after each video is handled.

Result: an interrupted batch resumes from the next unposted video instead of skipping the remainder. First-run initialization behavior is unchanged.

Testing

  • Python syntax validated for both files.
  • No existing tests assert on the old pre-advance behavior.

Previously check_for_new_videos() advanced and persisted last_video_id to
the newest video BEFORE the daemon posted the batch. If the process was
killed mid-batch (e.g. container restart), the unposted videos were
silently marked as seen and never posted.

Now state is advanced per-video via a new mark_posted() method that the
daemon calls after each video is successfully handled, so an interrupted
batch resumes from the next unposted video.
@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@ChiefGyk3D ChiefGyk3D self-assigned this Jul 14, 2026
@ChiefGyk3D
ChiefGyk3D merged commit bb4fd88 into main Jul 14, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant