Add support for cycling hero/featured similar artists by introducing a last_featured timestamp and using it to prefer least-recently-featured artists. Changes include: - DB migration: add _add_similar_artists_last_featured_column and call it during migrations to add a last_featured TIMESTAMP column (non-fatal on error). - Query changes: get_top_similar_artists now excludes watchlist artists via a LEFT JOIN and wa.id IS NULL and orders results by last_featured (nulls first), then by last_featured asc, occurrence_count desc, and similarity_rank asc. The query aliasing was also added for clarity. - New helper: mark_artists_featured updates similar_artists.last_featured = CURRENT_TIMESTAMP for shown artists. - Web server: increase fetch limit to 50, remove random shuffle and instead take the top 10 (already ordered by cycling logic), and call mark_artists_featured to rotate featured artists. These changes aim to provide deterministic, least-recently-shown cycling of hero artists while keeping watchlist artists out of recommendations. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| music_database.py | ||
| music_library.db | ||