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

Aperta
#1,623 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python, react, typescript

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
Python
Stelle
322
Fork
793
Merge medio
6g 10h
PR unite (30g)
20

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di AOSSIE-Org/PictoPy

Tutte le issue di AOSSIE-Org/PictoPy

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.