From 7ebd22568b148c074545ca92a379568834189079 Mon Sep 17 00:00:00 2001 From: cottongin Date: Sat, 28 Mar 2026 12:38:26 -0400 Subject: [PATCH] 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 --- SongRequest/config.py | 11 +++++++++++ SongRequest/plugin.py | 2 ++ 2 files changed, 13 insertions(+) diff --git a/SongRequest/config.py b/SongRequest/config.py index 085e337..35ea116 100644 --- a/SongRequest/config.py +++ b/SongRequest/config.py @@ -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", diff --git a/SongRequest/plugin.py b/SongRequest/plugin.py index 5e77ef5..68fdc7c 100644 --- a/SongRequest/plugin.py +++ b/SongRequest/plugin.py @@ -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)