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:
@@ -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",
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user