Browse Source

modify crud_video.py

tomoya 3 weeks ago
parent
commit
859aba2e3d
1 changed files with 5 additions and 0 deletions
  1. 5 0
      backend/app/app/crud/crud_video.py

+ 5 - 0
backend/app/app/crud/crud_video.py

@@ -39,6 +39,11 @@ class CRUDVideo(CRUDBase[Video, VideoCreate, VideoUpdate]):
             filename = random_name(n)
             if not db.query(self.model).filter(Video.stored_filename==filename).first():
               return filename
+          
+    def get_multi(
+        self, db: Session, *, skip: int = 0, limit: int = 100
+    ) -> List[Video]:
+        return db.query(self.model).order_by(desc(Video.id)).offset(skip).limit(limit).all()
 
 
 video = CRUDVideo(Video)