Skip to content

Fallback to random track if getsimilar returns empty#728

Open
spicyPoke wants to merge 2 commits into
eddyizm:developmentfrom
spicyPoke:fallback-to-random-track-if-getsimilar-returns-empty
Open

Fallback to random track if getsimilar returns empty#728
spicyPoke wants to merge 2 commits into
eddyizm:developmentfrom
spicyPoke:fallback-to-random-track-if-getsimilar-returns-empty

Conversation

@spicyPoke

@spicyPoke spicyPoke commented Jun 3, 2026

Copy link
Copy Markdown

Hi, I found that for some tracks that lack similarities with other tracks, Tempus will not add any track into the current queue when continuous play is active.
My proposal was to fallback to random tracks so it will continue playing regardless.

This PR make getContinuousMix use getSimilarSongs2 as the main functionality and fallback to getSimilarSongs if that fail. After that the result of it is filtered against the current queue, if it returns empty then we fallback to random 25 songs.

@spicyPoke spicyPoke changed the base branch from main to development June 3, 2026 14:22
@MaFo-28

MaFo-28 commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

One problem with continuous play is excessive filling of queue, especially with a small library.
That's why I suggested #721 which deletes part of queue before doing the getSimilarSongs.

These two approaches are not incompatible.

@spicyPoke

Copy link
Copy Markdown
Author

Hi @MaFo-28, yes, I agree.

I actually check #721 first to see if yours tackle the same issue. Since, this PR solves different part of the problem, I figured this can coexist with yours.

@MaFo-28

MaFo-28 commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Actually, I'm not a big fan of sending random tracks instead of similar songs.
Results will be very strange.

Perhaps we could add a "Random Fallback" preference, just below Continuous play option?

@eddyizm

eddyizm commented Jun 7, 2026

Copy link
Copy Markdown
Owner

We need to think about this as @MaFo-28 said, it is very jarring to have it do something unexpected.

I actually tried this in the not so distance past when I refactored a bunch of the play stuff and let me tell you, it was a disaster. Of course, most of it was due to my flawed implementation but even if it had worked as expected, it would still be sketch. I like the preference - I think with the other PR, we could make this a section. The discovery section kinda works this way already as a random feature.

@spicyPoke

Copy link
Copy Markdown
Author

Thank you for the feedbacks, I'll update the PR to include a preference in the option menu.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 988c60d2-b6a6-41f2-8e1e-7f8b0f044650

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@spicyPoke

spicyPoke commented Jun 9, 2026

Copy link
Copy Markdown
Author

Hi, I've updated the PR with preference switch.

@eddyizm

eddyizm commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Hi @spicyPoke
We made quite a bit of changes since this one was submitted. Thank you for adding the preference, that really upset folks when i first gave that as an option myself.
If you can resolve these conflicts, I will work on getting this into a dev soon.

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.

3 participants