update
This commit is contained in:
Binary file not shown.
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user