aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorMatt Kohls <mattkohls13@gmail.com>2018-10-16 17:58:38 -0400
committerMatt Kohls <mattkohls13@gmail.com>2018-10-16 17:58:38 -0400
commit266c900d573cc4b70683e290404af663eb3f66d0 (patch)
tree08317c3d50b4c4a1cabca37b35d5fa23b307ed39 /src/main/java
parent155bdfdffbae68f85cc971eb96ea432a6f4a736d (diff)
downloadSoundChan-266c900d573cc4b70683e290404af663eb3f66d0.tar.gz
SoundChan-266c900d573cc4b70683e290404af663eb3f66d0.tar.bz2
SoundChan-266c900d573cc4b70683e290404af663eb3f66d0.zip
Adding property setting for watching local sounds
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/soundchan/BotListener/BotListener.java14
1 files changed, 7 insertions, 7 deletions
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<Long, GuildMusicManager> 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();
+ }
}