This commit is contained in:
Marek
2026-04-05 22:20:51 +02:00
parent a67e1393d7
commit 375169f496
9 changed files with 40 additions and 1 deletions

View File

@@ -48,5 +48,17 @@ def update_file_path(db: Session, video_id: int, path: str):
db.commit()
def delete_not_downloaded(db: Session, profile_id: int) -> int:
videos = db.query(Video).filter(
Video.file_path.is_(None),
Video.profiles.any(Profile.id == profile_id),
).all()
count = len(videos)
for video in videos:
db.delete(video)
db.commit()
return count
def get_all_profiles(db: Session) -> list[Profile]:
return db.query(Profile).all()