Skip to content

feat: autoplay con artistas similares, pre-fill anticipado, cola prio…#38

Merged
Hitomatito merged 1 commit into
mainfrom
feature/autoplay-improvements
Jun 17, 2026
Merged

feat: autoplay con artistas similares, pre-fill anticipado, cola prio…#38
Hitomatito merged 1 commit into
mainfrom
feature/autoplay-improvements

Conversation

@Hitomatito

Copy link
Copy Markdown
Owner

…ritaria y dedup robusto

  • get_similar_artists_tracks: busca artistas co-escuchados via search?type=artist
  • Autoplay siempre mezcla mismo artista + artistas similares (sin filtro < MAX)
  • Pre-fill anticipado cuando quedan ≤2 canciones en cola
  • Seeding limpio al hacer /stop (evita contaminación entre géneros)
  • Eliminado search_youtube_by_genre (genres vacíos con Client Credentials)
  • Dedup por URL + autor|título + filtro primary_artist
  • original_uri seteado en autoplay para historial completo
  • Cola prioritaria: tracks de usuario insertados tras otros tracks del usuario

…ritaria y dedup robusto

- get_similar_artists_tracks: busca artistas co-escuchados via search?type=artist
- Autoplay siempre mezcla mismo artista + artistas similares (sin filtro < MAX)
- Pre-fill anticipado cuando quedan ≤2 canciones en cola
- Seeding limpio al hacer /stop (evita contaminación entre géneros)
- Eliminado search_youtube_by_genre (genres vacíos con Client Credentials)
- Dedup por URL + autor|título + filtro primary_artist
- original_uri seteado en autoplay para historial completo
- Cola prioritaria: tracks de usuario insertados tras otros tracks del usuario
Copilot AI review requested due to automatic review settings June 17, 2026 02:30
@Hitomatito Hitomatito merged commit 10d5813 into main Jun 17, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors autoplay seeding/dedup logic and enhances queue management so user-requested tracks are prioritized while autoplay pulls from the seed artist and similar artists (Spotify-first, YouTube fallback).

Changes:

  • Added new Spotify resolver helpers for artist top-tracks and “similar artists” discovery, plus expanded recommendation logic.
  • Implemented autoplay diversity/state tracking (seed/artist/url/title histories), early pre-fill when the queue is low, and cleaner state reset on stop.
  • Changed enqueue behavior to insert user tracks after existing user tracks (ahead of autoplay tracks) and added basic cache trimming.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
utils/spotify_resolver.py Updates Spotify recommendation strategy and adds new helper APIs for top-tracks and similar-artist track discovery.
cogs/music.py Reworks autoplay candidate generation, adds histories + early prefill, prioritizes user queue insertion, and trims caches.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread utils/spotify_resolver.py
Comment on lines +461 to +465
seed_artist_name = artists_data[0]["name"]
seed_url = data.get("external_urls", {}).get("spotify", "") or ""
exclude = exclude_artists or set()
exclude.add(seed_artist_name)

Comment thread cogs/music.py
Comment on lines +1556 to 1560
Uses YouTube search with artist name for related music discovery.
Rotates search queries to get different recommendations each time.
Adds 1 to AUTOPLAY_MAX_TRACKS tracks.
Returns the number of tracks added.
"""
Comment thread cogs/music.py
Comment on lines +1289 to +1290
for i, track in enumerate(tracks):
player.queue.insert(user_count + i, track)
Comment thread cogs/music.py
Comment on lines +1531 to +1532
for i, track in enumerate(tracks):
player.queue.insert(user_count + i, track)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants