implement JellyStat API for watch history, genre summary, and user summary; add PostgreSQL connection pool and update requirements
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
"""Pydantic response models for the JellyStat API."""
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class WatchHistoryItem(BaseModel):
|
||||
title: str
|
||||
watch_time_sec: float
|
||||
media_type: str
|
||||
|
||||
|
||||
class WatchHistoryResponse(BaseModel):
|
||||
user_id: str
|
||||
window_minutes: int
|
||||
items: list[WatchHistoryItem]
|
||||
|
||||
|
||||
class GenreSummaryItem(BaseModel):
|
||||
genre: str
|
||||
watch_time_sec: float
|
||||
|
||||
|
||||
class GenreSummaryResponse(BaseModel):
|
||||
user_id: str
|
||||
window_minutes: int
|
||||
genres: list[GenreSummaryItem]
|
||||
|
||||
|
||||
class UserSummaryResponse(BaseModel):
|
||||
user_id: str
|
||||
total_watch_time_sec: float
|
||||
most_watched_series: str | None
|
||||
most_watched_movie: str | None
|
||||
total_last_30d_sec: float
|
||||
total_last_7d_sec: float
|
||||
top_genres: list[str]
|
||||
Reference in New Issue
Block a user