How itspetros/moodlist works
MoodList turns mood, time, weather, and genre choices into an in-page song playlist: the browser loads available choices, requests a playlist, and displays playable YouTube links. The server filters and weights a locally seeded catalog, while a separate catalog-building workflow finds and validates YouTube videos. The repository also includes Google sign-in, profile pictures, and saved playlists, plus an installable offline app shell. The README documents background catalog lookups and playback-report handling; those links are shown as unverified because the relevant route excerpts are incomplete.
Main entry points: main.py Web API · catalog.py Catalog sync and picker · app.js Playlist interface · youtube.py Video matching
Components 16
Playlist experience
- Playlist interface
static/app.js - Offline app shell
static/sw.js - Web API
main.py
Song catalog
- Playlist options
options.py - Seed song catalog
data/seed_songs.csv - Catalog sync and picker
catalog.py - Song catalog database
catalog.py
Video resolution
- Catalog builder
build_catalog.py - Video matching
youtube.py - YouTube Data API
Accounts and saved playlists
- Token authentication
auth.py - Account and playlist models
models.py - Account and playlist schemas
schemas.py
Persistence
- Relational DB sessions
database.py - Account and playlist store
models.py
Other components
- Listener
Connections 27
- Listener → Playlist interface: chooses filters
README.md - Playlist interface → Web API: requests options
static/app.js - Playlist interface → Web API: requests playlist
static/app.js - Web API → Playlist options: returns choices
main.py - Web API → Catalog sync and picker: selects songs
main.py - Catalog sync and picker → Playlist options: validates tags
catalog.py - Catalog sync and picker → Seed song catalog: syncs songs
README.md - Catalog sync and picker → Song catalog database: reads and writes
catalog.py - Web API → Playlist interface: returns playlist
static/app.js - Playlist interface → Offline app shell: uses app shell
- Listener → Catalog builder: runs catalog build
README.md - Catalog builder → Catalog sync and picker: syncs and queues
build_catalog.py - Catalog builder → Video matching: resolves videos
build_catalog.py - Video matching → YouTube Data API: searches and checks
youtube.py - Video matching → Catalog sync and picker: records video results
youtube.py - Web API → Video matching: fills missing videos
README.md - Listener → Web API: signs in or saves
- Web API → Token authentication: checks user token
main.py - Token authentication → Account and playlist models: loads user
auth.py - Token authentication → Relational DB sessions: opens session
auth.py - Web API → Account and playlist models: manages accounts
main.py - Web API → Account and playlist schemas: validates responses
main.py - Account and playlist models → Account and playlist store: maps records
models.py - Web API → Relational DB sessions: uses sessions
main.py - Relational DB sessions → Account and playlist store: persists records
database.py - Playlist interface → YouTube Data API: opens video links
README.md - Web API → Catalog sync and picker: records playback reports
README.md