From 53b35df4e4b9b0156c6e2161d21bf11631a61e69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20W=C3=BCrfl?= Date: Fri, 18 May 2018 22:52:40 +0200 Subject: [PATCH] Put files in queue, match tracks case insensitive --- mumbleBot.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/mumbleBot.py b/mumbleBot.py index 0bf2d87..4cb40d5 100644 --- a/mumbleBot.py +++ b/mumbleBot.py @@ -114,12 +114,17 @@ class MumbleBot: path = os.path.abspath(os.path.join(music_folder, parameter)) if path.startswith(music_folder): if os.path.isfile(path): - self.launch_play_file(path) + #self.launch_play_file(path) + filename = path.replace(music_folder, '') + var.playlist.append(["file", filename]) else: # try to do a partial match - matches = [file for file in self.__get_recursive_filelist_sorted(music_folder) if parameter in file] - if len(matches) == 1: - self.launch_play_file(music_folder + matches[0]) + matches = [file for file in self.__get_recursive_filelist_sorted(music_folder) if parameter.lower() in file.lower()] + if len(matches) == 0: + self.mumble.users[text.actor].send_message(self.config.get('strings', 'no_file')) + elif len(matches) == 1: + #self.launch_play_file(music_folder + matches[0]) + var.playlist.append(["file", matches[0]]) else: msg = self.config.get('strings', 'multiple_matches') + '
' msg += '
'.join(matches)