Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to lavalink's lavaplayer fork #1490

Merged
merged 4 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
<name>m2-duncte123</name>
<url>https://m2.duncte123.dev/releases</url>
</repository>
<repository>
<id>arbjergDev-snapshots</id>
<name>Lavalink Repository</name>
<url>https://maven.lavalink.dev/snapshots</url>
</repository>
</repositories>

<dependencies>
Expand All @@ -47,17 +52,11 @@
</dependency>

<!-- Music Dependencies -->
<!-- using a fork of this to fix some issues faster -->

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can fix yourself

<!-- dependency>
<groupId>com.sedmelluq</groupId>
<artifactId>lavaplayer</artifactId>
<version>1.3.78</version>
</dependency -->
<dependency>
<groupId>com.github.jagrosh</groupId>
<artifactId>lavaplayer</artifactId>
<version>jmusicbot-SNAPSHOT</version>
</dependency>
<groupId>dev.arbjerg</groupId>
<artifactId>lavaplayer</artifactId>
<version>727959e9f621fc457b3a5adafcfffb55fdeaa538-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.github.jagrosh</groupId>
<artifactId>JLyrics</artifactId>
Expand All @@ -68,7 +67,7 @@
<artifactId>sourcemanagers</artifactId>
<version>1.9.0</version>
</dependency>

<!-- Misc Internal Dependencies -->
<dependency>
<groupId>ch.qos.logback</groupId>
Expand Down
44 changes: 44 additions & 0 deletions src/main/java/com/jagrosh/jmusicbot/utils/LogBackTurboFilter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright 2024 John Grosh <[email protected]>.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.jagrosh.jmusicbot.utils;

import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.turbo.TurboFilter;
import ch.qos.logback.core.spi.FilterReply;
import org.slf4j.Marker;

/**
* A TurboFilter, currently only used to suppress specific log messages from libraries.
*
* @author Michaili K. <[email protected]>
*/
public class LogBackTurboFilter extends TurboFilter
{
@Override
public FilterReply decide(Marker marker, Logger logger, Level level, String format, Object[] params, Throwable t)
{
// Suppresses the auth token warning from the YoutubeAudioSourceManager
// https://github.com/jagrosh/MusicBot/pull/1490#issuecomment-1974070225
if (logger.getName().equals("com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAccessTokenTracker")
&& format.equals("YouTube auth tokens can't be retrieved because email and password is not set in YoutubeAudioSourceManager, age restricted videos will throw exceptions.")
) {
return FilterReply.DENY;
}

return FilterReply.NEUTRAL;
}
}
2 changes: 2 additions & 0 deletions src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@
<appender-ref ref="Simple"/>
</root>

<turboFilter class="com.jagrosh.jmusicbot.utils.LogBackTurboFilter" />

</configuration>
Loading