From 266c900d573cc4b70683e290404af663eb3f66d0 Mon Sep 17 00:00:00 2001 From: Matt Kohls Date: Tue, 16 Oct 2018 17:58:38 -0400 Subject: Adding property setting for watching local sounds --- src/main/java/soundchan/BotListener/BotListener.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/main/java/soundchan') diff --git a/src/main/java/soundchan/BotListener/BotListener.java b/src/main/java/soundchan/BotListener/BotListener.java index 9177385..0dad6c0 100644 --- a/src/main/java/soundchan/BotListener/BotListener.java +++ b/src/main/java/soundchan/BotListener/BotListener.java @@ -36,7 +36,6 @@ public class BotListener extends ListenerAdapter{ private final AudioPlayerManager playerManager; private final Map musicManagers; private BotListenerHelpers helper = new BotListenerHelpers(); - private ExecutorService executorService; private Future future; // From configuration file @@ -51,8 +50,6 @@ public class BotListener extends ListenerAdapter{ AudioSourceManagers.registerRemoteSources(playerManager); AudioSourceManagers.registerLocalSource(playerManager); - executorService = Executors.newSingleThreadExecutor(); - loadProperties(properties); } @@ -75,10 +72,13 @@ public class BotListener extends ListenerAdapter{ } else localManager = new LocalAudioManager(localFilePath); - - DirectoryWatcher directoryWatcher = new DirectoryWatcher(localManager, localFilePath); - future = executorService.submit(directoryWatcher); - executorService.shutdown(); + + if(settingEnableCheck(properties.getProperty("watchLocalFilePath"))) { + ExecutorService executorService = Executors.newSingleThreadExecutor(); + DirectoryWatcher directoryWatcher = new DirectoryWatcher(localManager, localFilePath); + future = executorService.submit(directoryWatcher); + executorService.shutdown(); + } } -- cgit v1.2.3