Skip to content

Commit

Permalink
Documentation update and regex fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DxsSucuk committed Jun 8, 2023
1 parent 3b0a60c commit 7a59ea7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class SpotifyAPIHandler {
/**
* The Regex for Spotify Links.
*/
private static final String REGEX = "^(https?://(?:open\\.)?spotify\\.com/(embed|track|album|playlist|artist)/(\\w+)).*";
private static final String REGEX = "^(https?://(?:open\\.)?spotify\\.com/(?:[\\w-]+/)*?(embed|track|album|playlist|artist)/(\\w+)).*";

/**
* The Pattern for Spotify Links.
Expand Down Expand Up @@ -221,6 +221,11 @@ public ArrayList<String> convert(String link) throws ParseException, SpotifyWebA
return new ArrayList<>();
}

/**
* Parse a Spotify URL.
* @param spotifyURL The Spotify URL.
* @return The Type and ID of the URL.
*/
public static String[] parseSpotifyURL(String spotifyURL) {
Matcher matcher = pattern.matcher(spotifyURL);

Expand Down
12 changes: 12 additions & 0 deletions src/main/java/de/presti/ree6/utils/data/Data.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,26 @@ public static boolean isModuleActive(String moduleName) {
return Main.getInstance().getConfig().getConfiguration().getBoolean("bot.misc.modules." + moduleName, true);
}

/**
* Get the configured Twitch Auth Url.
* @return the Twitch Auth Url from the config.
*/
public static String getTwitchAuth() {
return Main.getInstance().getConfig().getConfiguration().getString("bot.misc.twitchAuth", "https://cp.ree6.de/external/twitch");
}

/**
* Get the configured Recording Url.
* @return the Recording Url from the config.
*/
public static String getRecordingUrl() {
return Main.getInstance().getConfig().getConfiguration().getString("bot.misc.recording", "https://cp.ree6.de/external/recording");
}

/**
* Get the configured Webinterface Url.
* @return the Webinterface Url from the config.
*/
public static String getWebinterface() {
return Main.getInstance().getConfig().getConfiguration().getString("bot.misc.webinterface", "https://cp.ree6.de");
}
Expand Down

0 comments on commit 7a59ea7

Please sign in to comment.