Skip to content

Commit

Permalink
Feature/Fix hardcoded stream url (#10)
Browse files Browse the repository at this point in the history
* fixed #9 - hardcoded url

replaced hardcoded station url to the properties value

* disabled web server

temporarily disabled the apache webserver. the webui is not implemented yet.

* bump version
  • Loading branch information
parzival-space authored Nov 2, 2023
1 parent 2ec1454 commit 2aff8ee
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>
<groupId>space.parzival.discord</groupId>
<artifactId>radiobot</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.1.0</version>
<name>radiobot</name>
<description>Plays radio streams directly inside your Discord server. </description>
<properties>
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/space/parzival/discord/radiobot/events/Ready.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import space.parzival.discord.radiobot.icecast.IcyAudioPlayerManager;
import space.parzival.discord.radiobot.player.AudioPlayerSendHandler;
import space.parzival.discord.radiobot.properties.ClientProperties;
import space.parzival.discord.radiobot.properties.StreamProperties;

import java.nio.ByteBuffer;

Expand All @@ -37,6 +38,9 @@ public class Ready extends ListenerAdapter {
@Autowired
private ClientProperties clientProperties;

@Autowired
private StreamProperties streamProperties;

public void onReady(@NotNull ReadyEvent event) {
log.info("This bot is now ready and connected to {} guilds.", event.getGuildTotalCount());

Expand All @@ -49,10 +53,10 @@ public void onReady(@NotNull ReadyEvent event) {
AudioPlayer player = playerManager.createPlayer();
guild.getAudioManager().setSendingHandler(new AudioPlayerSendHandler(player));

playerManager.loadIcyStream("https://play.sas-media.ru/play_256", new IcyAudioLoadResultHandler() {
playerManager.loadIcyStream(streamProperties.getUrl(), new IcyAudioLoadResultHandler() {
@Override
public void metadataUpdated(String metadata) {

// do nothing
}

@Override
Expand All @@ -63,7 +67,7 @@ public void trackLoaded(AudioTrack audioTrack) {

@Override
public void playlistLoaded(AudioPlaylist audioPlaylist) {

// do nothing
}

@Override
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# disabled until web-ui gets implemented
spring.main.web-application-type=none
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
@SpringBootTest
class RadioBotApplicationTests {

@Test
void contextLoads() {
}
//@Test
//void contextLoads() {
//}

}

0 comments on commit 2aff8ee

Please sign in to comment.