Add per-channel "Feeling Lucky" mode to auto-select first iTunes match

When enabled, skips the IRC disambiguation prompt and immediately
queues the top result. Remaining matches are stored as alternates
visible in the web dashboard with approve buttons.

Made-with: Cursor
This commit is contained in:
cottongin
2026-03-28 12:38:26 -04:00
parent 2f33b43bbe
commit 7ebd22568b
2 changed files with 13 additions and 0 deletions

View File

@@ -172,6 +172,17 @@ conf.registerChannelValue(
),
)
conf.registerChannelValue(
SongRequest,
"feelingLucky",
registry.Boolean(
False,
_("""When True, automatically select the first iTunes match
instead of prompting the user to disambiguate. Remaining
matches are stored as alternates visible in the web panel."""),
),
)
conf.registerChannelValue(
SongRequest,
"passiveDetection",

View File

@@ -225,6 +225,8 @@ class SongRequest(callbacks.Plugin):
if len(tracks) == 1:
self._submit_request(irc, msg, tracks[0])
elif self.registryValue("feelingLucky", msg.channel, irc.network):
self._submit_request(irc, msg, tracks[0], alternates=tracks[1:])
else:
self._present_choices(irc, msg, tracks, max_choices)