Skip to content

Fix: remove deleted videos from playlists#108

Merged
alexneamtu merged 1 commit intomainfrom
fix/remove-deleted-videos-from-playlists
Mar 4, 2026
Merged

Fix: remove deleted videos from playlists#108
alexneamtu merged 1 commit intomainfrom
fix/remove-deleted-videos-from-playlists

Conversation

@alexneamtu
Copy link
Contributor

Summary

  • Videos use soft delete (status = 'deleted'), so the ON DELETE CASCADE foreign key on playlist_videos never fires
  • Added explicit DELETE FROM playlist_videos in both single delete and batch delete handlers
  • Cleanup runs synchronously before the response, so playlists are immediately consistent

Test plan

  • TestDelete_Success — expects playlist_videos cleanup
  • TestDelete_MarksFilePurgedOnSuccess — includes playlist cleanup expectation
  • TestDelete_CleansUpWebcamFile — includes playlist cleanup expectation
  • TestDelete_CleansUpTranscriptFile — includes playlist cleanup expectation
  • TestBatchDelete_Success — expects bulk playlist cleanup
  • TestBatchDelete_PartialOwnership — only cleans up actually deleted video IDs

Videos are soft-deleted (status='deleted') so the ON DELETE CASCADE
on playlist_videos never fires. Explicitly delete playlist_videos
rows in both single and batch delete handlers.
@github-actions
Copy link

github-actions bot commented Mar 4, 2026

Preview deployed: https://pr-108.app.sendrec.eu

@alexneamtu alexneamtu self-assigned this Mar 4, 2026
@alexneamtu alexneamtu merged commit 2a15688 into main Mar 4, 2026
4 checks passed
@alexneamtu alexneamtu deleted the fix/remove-deleted-videos-from-playlists branch March 4, 2026 20:10
@github-actions
Copy link

github-actions bot commented Mar 4, 2026

Preview environment cleaned up.

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