Skip to content

Commit

Permalink
Add config option for enabling NicoAudioSourceManager (#1027)
Browse files Browse the repository at this point in the history
* add config option and support for nico

* enable nico by default

* add note on http source

* add nico source into environment variables

---------

Co-authored-by: Toπ <git@topi.wtf>
  • Loading branch information
devoxin and topi314 authored Mar 25, 2024
1 parent 836103b commit c1ff05d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion LavalinkServer/application.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ lavalink:
soundcloud: true
twitch: true
vimeo: true
http: true
nico: true
http: true # warning: keeping HTTP enabled without a proxy configured could expose your server's IP address.
local: false
filters: # All filters are enabled by default
volume: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import com.sedmelluq.discord.lavaplayer.source.AudioSourceManager
import com.sedmelluq.discord.lavaplayer.source.bandcamp.BandcampAudioSourceManager
import com.sedmelluq.discord.lavaplayer.source.http.HttpAudioSourceManager
import com.sedmelluq.discord.lavaplayer.source.local.LocalAudioSourceManager
import com.sedmelluq.discord.lavaplayer.source.nico.NicoAudioSourceManager
import com.sedmelluq.discord.lavaplayer.source.soundcloud.*
import com.sedmelluq.discord.lavaplayer.source.twitch.TwitchStreamAudioSourceManager
import com.sedmelluq.discord.lavaplayer.source.vimeo.VimeoAudioSourceManager
Expand Down Expand Up @@ -155,6 +156,7 @@ class AudioPlayerConfiguration {
if (sources.isBandcamp) audioPlayerManager.registerSourceManager(BandcampAudioSourceManager())
if (sources.isTwitch) audioPlayerManager.registerSourceManager(TwitchStreamAudioSourceManager())
if (sources.isVimeo) audioPlayerManager.registerSourceManager(VimeoAudioSourceManager())
if (sources.isNico) audioPlayerManager.registerSourceManager(NicoAudioSourceManager())
if (sources.isLocal) audioPlayerManager.registerSourceManager(LocalAudioSourceManager(mcr))

audioSourceManagers.forEach {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ data class AudioSourcesConfig(
var isSoundcloud: Boolean = true,
var isTwitch: Boolean = true,
var isVimeo: Boolean = true,
var isNico: Boolean = false,
var isHttp: Boolean = true,
var isLocal: Boolean = false,
)
1 change: 1 addition & 0 deletions docs/configuration/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ LAVALINK_SERVER_SOURCES_SOUNDCLOUD
LAVALINK_SERVER_SOURCES_TWITCH
LAVALINK_SERVER_SOURCES_VIMEO
LAVALINK_SERVER_SOURCES_HTTP
LAVALINK_SERVER_SOURCES_NICO
LAVALINK_SERVER_SOURCES_LOCAL
LAVALINK_SERVER_FILTERS_VOLUME
Expand Down

0 comments on commit c1ff05d

Please sign in to comment.