From f253a9ca28eef1e7c2f00eb1dec2f88309aaa624 Mon Sep 17 00:00:00 2001 From: duncte123 Date: Mon, 8 Feb 2021 10:40:00 +0100 Subject: [PATCH] upgrade source managers --- build.gradle.kts | 4 ++-- .../sourcemanagers/spotify/SpotifyAudioSourceManager.java | 4 ++-- .../youtube/YoutubeAudioSourceManagerOverride.java | 1 + .../skybot/commands/guild/owner/settings/SettingsCommand.java | 4 ++-- .../ml/duncte123/skybot/listeners/InviteTrackingListener.java | 2 +- .../ml/duncte123/skybot/adapters/SqliteDatabaseAdapter.kt | 4 ++-- .../ml/duncte123/skybot/web/handlers/GuildSettingsHandler.kt | 4 ++-- 7 files changed, 12 insertions(+), 11 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index ee67d2672..94ae1a7f2 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -102,10 +102,10 @@ dependencies { exclude(module = "opus-java") }*/ - implementation(group = "com.dunctebot", name = "sourcemanagers", version = "1.4.0") + implementation(group = "com.github.DuncteBot", name = "skybot-source-managers", version = "1.5.0") // Lavaplayer/Lavalink implementation(group = "com.sedmelluq", name = "lavaplayer", version = "1.3.67") - implementation(group = "com.github.dunctebot", name = "Lavalink-Client", version = "478fbea") + implementation(group = "com.github.DuncteBot", name = "Lavalink-Client", version = "d2fb620") // implementation(project(":Lavalink-Client")) //groovy diff --git a/src/main/java/ml/duncte123/skybot/audio/sourcemanagers/spotify/SpotifyAudioSourceManager.java b/src/main/java/ml/duncte123/skybot/audio/sourcemanagers/spotify/SpotifyAudioSourceManager.java index 32cbca5ec..3d1b05f9e 100644 --- a/src/main/java/ml/duncte123/skybot/audio/sourcemanagers/spotify/SpotifyAudioSourceManager.java +++ b/src/main/java/ml/duncte123/skybot/audio/sourcemanagers/spotify/SpotifyAudioSourceManager.java @@ -19,7 +19,7 @@ package ml.duncte123.skybot.audio.sourcemanagers.spotify; import com.dunctebot.sourcemanagers.AudioTrackInfoWithImage; -import com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager; +import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager; import com.sedmelluq.discord.lavaplayer.source.AudioSourceManager; import com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioSourceManager; import com.sedmelluq.discord.lavaplayer.tools.ExceptionTools; @@ -96,7 +96,7 @@ public String getSourceName() { } @Override - public AudioItem loadItem(DefaultAudioPlayerManager manager, AudioReference reference) { + public AudioItem loadItem(AudioPlayerManager manager, AudioReference reference) { return loadItem(reference, false); } diff --git a/src/main/java/ml/duncte123/skybot/audio/sourcemanagers/youtube/YoutubeAudioSourceManagerOverride.java b/src/main/java/ml/duncte123/skybot/audio/sourcemanagers/youtube/YoutubeAudioSourceManagerOverride.java index 54304bb86..81eda6538 100644 --- a/src/main/java/ml/duncte123/skybot/audio/sourcemanagers/youtube/YoutubeAudioSourceManagerOverride.java +++ b/src/main/java/ml/duncte123/skybot/audio/sourcemanagers/youtube/YoutubeAudioSourceManagerOverride.java @@ -40,6 +40,7 @@ public YoutubeAudioSourceManagerOverride(CacheClient cacheClient, String ytApiKe true, new DefaultYoutubeTrackDetailsLoader(), new YoutubeApiSearchProvider(ytApiKey, cacheClient), + new YoutubeSearchMusicProvider(), new YoutubeSignatureCipherManager(), new YoutubeApiPlaylistLoader(ytApiKey), new DefaultYoutubeLinkRouter(), diff --git a/src/main/java/ml/duncte123/skybot/commands/guild/owner/settings/SettingsCommand.java b/src/main/java/ml/duncte123/skybot/commands/guild/owner/settings/SettingsCommand.java index 4574947e2..4cc64f51c 100644 --- a/src/main/java/ml/duncte123/skybot/commands/guild/owner/settings/SettingsCommand.java +++ b/src/main/java/ml/duncte123/skybot/commands/guild/owner/settings/SettingsCommand.java @@ -569,9 +569,9 @@ private void swearFilterSetting(CommandContext ctx, String name, boolean setValu private void inviteLoggingSetting(CommandContext ctx, String name, boolean setValue) { final DunctebotGuild guild = ctx.getGuild(); final GuildSetting settings = guild.getSettings(); - final boolean isEnabled = !settings.isInviteLoggingEnabled(); + final boolean isEnabled = !settings.isFilterInvites(); - guild.setSettings(settings.setInviteLoggingEnabled(isEnabled)); + guild.setSettings(settings.setFilterInvites(isEnabled)); sendMsg(ctx, "The logging of invites has been toggled **" + (isEnabled ? "on" : "off") + "**"); diff --git a/src/main/java/ml/duncte123/skybot/listeners/InviteTrackingListener.java b/src/main/java/ml/duncte123/skybot/listeners/InviteTrackingListener.java index e19b3fb84..a9a0cd379 100644 --- a/src/main/java/ml/duncte123/skybot/listeners/InviteTrackingListener.java +++ b/src/main/java/ml/duncte123/skybot/listeners/InviteTrackingListener.java @@ -198,6 +198,6 @@ private boolean isInviteLoggingEnabled(Guild guild) { final GuildSetting guildSetting = GuildSettingsUtils.getGuild(guild.getIdLong(), variables); - return guildSetting.isInviteLoggingEnabled(); + return guildSetting.isFilterInvites(); } } diff --git a/src/main/kotlin/ml/duncte123/skybot/adapters/SqliteDatabaseAdapter.kt b/src/main/kotlin/ml/duncte123/skybot/adapters/SqliteDatabaseAdapter.kt index 2cf594e42..0846b2e77 100644 --- a/src/main/kotlin/ml/duncte123/skybot/adapters/SqliteDatabaseAdapter.kt +++ b/src/main/kotlin/ml/duncte123/skybot/adapters/SqliteDatabaseAdapter.kt @@ -245,7 +245,7 @@ class SqliteDatabaseAdapter : DatabaseAdapter(1) { it.setString(24, guildSettings.filterType.type) it.setFloat(25, guildSettings.aiSensitivity) it.setBoolean(26, guildSettings.isAllowAllToStop) - it.setBoolean(27, guildSettings.isInviteLoggingEnabled) + it.setBoolean(27, guildSettings.isFilterInvites) it.setBoolean(28, guildSettings.isYoungAccountBanEnabled) it.setInt(29, guildSettings.youngAccountThreshold) it.executeUpdate() @@ -1134,7 +1134,7 @@ class SqliteDatabaseAdapter : DatabaseAdapter(1) { .setFilterType(this.getString("profanity_type")) .setAiSensitivity(this.getFloat("aiSensitivity")) .setAllowAllToStop(this.getBoolean("allow_all_to_stop")) - .setInviteLoggingEnabled(this.getBoolean("invite_logging")) + .setFilterInvites(this.getBoolean("invite_logging")) .setBlacklistedWords(blackList) .setWarnActions(warnActions) .setEmbedColor(embedColor) diff --git a/src/main/kotlin/ml/duncte123/skybot/web/handlers/GuildSettingsHandler.kt b/src/main/kotlin/ml/duncte123/skybot/web/handlers/GuildSettingsHandler.kt index 21c62e6dc..180500365 100644 --- a/src/main/kotlin/ml/duncte123/skybot/web/handlers/GuildSettingsHandler.kt +++ b/src/main/kotlin/ml/duncte123/skybot/web/handlers/GuildSettingsHandler.kt @@ -61,12 +61,12 @@ class GuildSettingsHandler(private val variables: Variables, client: WebSocketCl val tracker = guild.globalInviteTracker // setting was turned on - if (oldSetting?.isInviteLoggingEnabled == false && setting.isInviteLoggingEnabled) { + if (oldSetting?.isFilterInvites == false && setting.isFilterInvites) { if (CommandUtils.isGuildPatron(guild)) { tracker.attemptInviteCaching(guild) } // setting was turned off - } else if (oldSetting?.isInviteLoggingEnabled == true && !setting.isInviteLoggingEnabled) { + } else if (oldSetting?.isFilterInvites == true && !setting.isFilterInvites) { tracker.clearInvites(setting.guildId) } }