From da2e92d950cc2369af3a72e76532e7841cd351aa Mon Sep 17 00:00:00 2001 From: clemens Date: Tue, 16 Jan 2018 10:53:05 +0100 Subject: [PATCH] fix errors --- soundboard.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/soundboard.py b/soundboard.py index f32f153..e9cae13 100644 --- a/soundboard.py +++ b/soundboard.py @@ -153,5 +153,5 @@ def sounds(name): @app.route("/random") def play_random(): sounds = [os.fsencode(file).decode() for file in os.listdir(config.path)] - random_sound = random.sample(sounds, 1) - subprocess.Popen(["omxplayer", os.path.join(config.path, random_sound.encode("utf-8")], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) \ No newline at end of file + random_sound = random.sample(sounds, 1)[0] + subprocess.Popen(["omxplayer", os.path.join(config.path, random_sound).encode("utf-8")], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) \ No newline at end of file