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)