Hindimovieslink -
class WatchlistIn(BaseModel): movie_id: int
# ------------------------------------------------- # 5️⃣ Notification subscription (price‑drop) # ------------------------------------------------- @app.post("/me/alerts", response_model=schemas.AlertOut) def create_price_alert( payload: schemas.AlertIn, user: models.User = Depends(auth.get_current_user), db: Session = Depends(auth.get_db) ): return crud.create_price_alert(db, user.id, payload) class MovieOut(BaseModel): id: int title: str year: Optional[int] poster_url: Optional[str] rating_imdb: Optional[float] hindimovieslink
-- Watch‑Later / Favorites CREATE TABLE user_lists ( id BIGSERIAL PRIMARY KEY, user_id BIGINT REFERENCES users(id) ON DELETE CASCADE, movie_id BIGINT REFERENCES movies(id) ON DELETE CASCADE, list_type TEXT CHECK (list_type IN ('watch_later','favorites')), created_at TIMESTAMP DEFAULT now(), UNIQUE(user_id, movie_id, list_type) ); Add pg_trgm indexes for fuzzy title search: user: models.User = Depends(auth.get_current_user)
# ------------------------------------------------- # 2️⃣ Get Movie Details + Links # ------------------------------------------------- @app.get("/movies/movie_id", response_model=schemas.MovieDetail) def get_movie(movie_id: int, db: Session = Depends(auth.get_db)): movie = crud.get_movie_with_links(db, movie_id) if not movie: raise HTTPException(status_code=404, detail="Movie not found") return movie list_type TEXT CHECK (list_type IN ('watch_later'
class Config: orm_mode = True