Add playlists support and fix explore older videos
- New playlists router: fetch channel playlists from YouTube, index playlist videos, browse by playlist with pagination - Playlist model gets video_ids column to store ordered video list - Register playlists router in main.py with DB migration - Add Playlists tab to Channel page: grid of playlist cards, click to browse videos, index/re-index per playlist - Fix explore older videos skipping all entries without published_at; flat-playlist entries for older videos rarely include timestamp data Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -203,6 +203,21 @@ class CollectionItem(Base):
|
||||
added_at = Column(DateTime, default=datetime.utcnow)
|
||||
|
||||
|
||||
class Playlist(Base):
|
||||
__tablename__ = "playlists"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
youtube_playlist_id = Column(String, unique=True, nullable=False, index=True)
|
||||
channel_id = Column(Integer, ForeignKey("channels.id", ondelete="CASCADE"), nullable=True)
|
||||
title = Column(String, nullable=False)
|
||||
description = Column(Text)
|
||||
thumbnail_url = Column(String)
|
||||
video_count = Column(Integer, default=0)
|
||||
video_ids = Column(Text) # JSON array of youtube_video_id strings
|
||||
indexed_at = Column(DateTime)
|
||||
crawled_at = Column(DateTime, default=datetime.utcnow)
|
||||
|
||||
|
||||
class GraphEdge(Base):
|
||||
__tablename__ = "graph_edges"
|
||||
__table_args__ = (UniqueConstraint("from_channel_id", "to_channel_id"),)
|
||||
|
||||
Reference in New Issue
Block a user