Fixed and added all the stats_service.py methods

This commit is contained in:
bnair123
2025-12-25 22:17:21 +04:00
parent e7980cc706
commit 9b8f7355fb
9 changed files with 412 additions and 146 deletions

View File

@@ -17,6 +17,7 @@ class Artist(Base):
id = Column(String, primary_key=True, index=True) # Spotify ID
name = Column(String)
genres = Column(JSON, nullable=True) # List of genre strings
image_url = Column(String, nullable=True) # Artist profile image
# Relationships
tracks = relationship("Track", secondary=track_artists, back_populates="artists")
@@ -28,6 +29,7 @@ class Track(Base):
name = Column(String)
artist = Column(String) # Display string (e.g. "Drake, Future") - kept for convenience
album = Column(String)
image_url = Column(String, nullable=True) # Album art
duration_ms = Column(Integer)
popularity = Column(Integer, nullable=True)
@@ -53,6 +55,7 @@ class Track(Base):
genres = Column(JSON, nullable=True)
# AI Analysis fields
lyrics = Column(Text, nullable=True) # Full lyrics from Genius
lyrics_summary = Column(String, nullable=True)
genre_tags = Column(String, nullable=True)