Video source upload video cleanup#6994
Merged
Merged
Conversation
⏱️ Backend import time —
|
| Accelerator | Cumulative (s) | Self (s) |
|---|---|---|
cpu |
4.868 | 0.004 |
xpu |
4.844 | 0.004 |
cuda |
5.331 | 0.004 |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds backend-side cleanup of uploaded “video_file” source media so that removing a video source (or replacing its uploaded video) also removes the previously uploaded file/directory from disk.
Changes:
- Add
SourceMediaService.delete_video()and call it (best-effort) when deleting avideo_filesource. - On
video_filesource updates, delete the old uploaded video whenvideo_pathchanges. - Wire
SourceMediaServiceinto theSourceUpdateServicedependency and add unit/integration coverage for the cleanup behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| application/backend/app/services/source_media_service.py | Adds delete_video() helper to remove uploaded video directories. |
| application/backend/app/services/source_service.py | Integrates best-effort media deletion into source delete/update flows. |
| application/backend/app/api/dependencies.py | Injects SourceMediaService into SourceUpdateService. |
| application/backend/tests/unit/services/test_source_media_service.py | Adds unit tests for delete behavior and safety boundaries. |
| application/backend/tests/integration/services/test_source_service.py | Verifies old-video cleanup is triggered on update/delete via mocked media service. |
🐳 Docker image sizes
|
📊 Test coverage report
|
A-Artemis
approved these changes
Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow up from #6981
Final part of #6931
How to test
Checklist