Feat: In-App Video Deletion with Disk/Database Options and Library Exclusion

Open
#1,623 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
python, react, typescript

Research direction

Read the image deletion workflow in backend/app/routes/images.py and compare it with backend/app/database/videos.py, backend/app/routes/videos.py, and backend/app/utils/videos.py. Then trace the viewer controls and overlay in frontend/src/components/VideoPlayer/VideoViewerControls.tsx and VideoPlayerOverlay.tsx. Done means video deletion supports both disk deletion and database-only removal, and excluded files stay out of later scans.

Written by the indexing model from the issue text.

Description

enhancement possible-duplicate
Describe the feature
Problem Statement

Currently, there is no way to delete or remove video files from within PictoPy:

  1. Frontend Viewer: In the full-screen video player (frontend/src/components/VideoPlayer/VideoViewerControls.tsx), only Info, Open Folder, and Favorite buttons exist. There is no Delete button or confirmation dialog. Users have to manually locate the video in their OS file explorer to delete it.
  2. Missing Database & API Layer: Unlike images (which received full deletion support via PR #1547 and backend/app/routes/images.py), backend/app/routes/videos.py has no DELETE endpoint, and backend/app/database/videos.py lacks deletion methods (db_delete_videos_by_ids).
  3. Scan Re-Import Loop: The database does not maintain an excluded_video_paths table. Without this, if a user removes a video from the gallery without deleting the physical file, the next background folder scan will immediately re-index and re-import it.
Proposed Solution

Implement complete video deletion parity with the image deletion workflow across the full stack:

  • Database Layer (backend/app/database/videos.py):
    • Create the excluded_video_paths (path VARCHAR PRIMARY KEY, folder_id INTEGER) table.
    • Implement db_get_excluded_video_paths(), db_delete_videos_by_ids(), and db_exclude_and_delete_videos().
    • Add exclusion checks during video scanning so excluded paths are not re-imported.
  • Backend API (backend/app/routes/videos.py & backend/app/utils/videos.py):
    • Implement video_util_delete_videos(video_ids, delete_from_device).
    • Expose a DELETE /videos/delete-videos endpoint accepting video IDs and a delete_from_device boolean flag.
  • Frontend Integration (frontend/src/):
    • Add deleteVideos in frontend/src/api/api-functions/videos.ts and create useDeleteVideos.ts mutation hook.
    • Add a Delete (Trash2) icon to VideoViewerControls.tsx.
    • Trigger the delete confirmation dialog in VideoPlayerOverlay.tsx, offering the choice to delete from disk or remove from PictoPy database only.
Expected Impact
  • Complete parity between image and video viewing workflows.
  • Users gain full control over managing and removing videos directly from the interface.
  • Prevents deleted videos from reappearing on subsequent library scans.
Add ScreenShots

The delete button does not exist in the code yet.

Record
  • I agree to follow this project's Code of Conduct
  • I want to work on this issue
Dominant language
Python
Stars
322
Forks
793
Avg merge
6d 10h
Merged PRs (30d)
20

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from AOSSIE-Org/PictoPy

All issues in AOSSIE-Org/PictoPy

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.