s/SUBSONIC/LIBRESONIC

Signed-off-by: Bernardus Jansen <bernardus@bajansen.nl>
master
Bernardus Jansen 8 years ago
parent 747ab8db2d
commit 32c1bb31ac
  1. 6
      libresonic-booter/src/main/java/net/sourceforge/libresonic/booter/deployer/LibresonicDeployer.java
  2. 12
      libresonic-booter/src/main/script/libresonic.bat
  3. 66
      libresonic-booter/src/main/script/libresonic.sh
  4. 8
      libresonic-installer-debian/src/etc/default/libresonic
  5. 14
      libresonic-installer-debian/src/etc/init.d/libresonic
  6. 12
      libresonic-installer-mac/src/postinstall.sh
  7. 8
      libresonic-installer-mac/src/preinstall.sh
  8. 14
      libresonic-installer-rpm/src/etc/init.d/libresonic
  9. 8
      libresonic-installer-rpm/src/etc/sysconfig/libresonic
  10. 2
      libresonic-main/src/main/java/org/libresonic/player/Logger.java
  11. 2
      libresonic-main/src/main/java/org/libresonic/player/controller/StreamController.java
  12. 4
      libresonic-main/src/main/java/org/libresonic/player/io/PlayQueueInputStream.java
  13. 6
      libresonic-main/src/main/java/org/libresonic/player/service/SettingsService.java
  14. 4
      libresonic-main/src/main/java/org/libresonic/player/service/VersionService.java
  15. 8
      libresonic-main/src/main/java/org/libresonic/player/service/sonos/SonosHelper.java
  16. 8
      libresonic-main/src/test/java/net/sourceforge/libresonic/service/SettingsServiceTestCase.java
  17. 2
      libresonic-transcode/windows/README.TXT

@ -48,8 +48,8 @@ public class LibresonicDeployer implements LibresonicDeployerService {
private static final int HEADER_BUFFER_SIZE = 64 * 1024; private static final int HEADER_BUFFER_SIZE = 64 * 1024;
// Libresonic home directory. // Libresonic home directory.
private static final File SUBSONIC_HOME_WINDOWS = new File("c:/libresonic"); private static final File LIBRESONIC_HOME_WINDOWS = new File("c:/libresonic");
private static final File SUBSONIC_HOME_OTHER = new File("/var/libresonic"); private static final File LIBRESONIC_HOME_OTHER = new File("/var/libresonic");
private Throwable exception; private Throwable exception;
private File libresonicHome; private File libresonicHome;
@ -311,7 +311,7 @@ public class LibresonicDeployer implements LibresonicDeployerService {
home = new File(overrideHome); home = new File(overrideHome);
} else { } else {
boolean isWindows = System.getProperty("os.name", "Windows").toLowerCase().startsWith("windows"); boolean isWindows = System.getProperty("os.name", "Windows").toLowerCase().startsWith("windows");
home = isWindows ? SUBSONIC_HOME_WINDOWS : SUBSONIC_HOME_OTHER; home = isWindows ? LIBRESONIC_HOME_WINDOWS : LIBRESONIC_HOME_OTHER;
} }
// Attempt to create home directory if it doesn't exist. // Attempt to create home directory if it doesn't exist.

@ -1,24 +1,24 @@
@echo off @echo off
REM The directory where Libresonic will create files. Make sure it is writable. REM The directory where Libresonic will create files. Make sure it is writable.
set SUBSONIC_HOME=c:\libresonic set LIBRESONIC_HOME=c:\libresonic
REM The host name or IP address on which to bind Libresonic. Only relevant if you have REM The host name or IP address on which to bind Libresonic. Only relevant if you have
REM multiple network interfaces and want to make Libresonic available on only one of them. REM multiple network interfaces and want to make Libresonic available on only one of them.
REM The default value 0.0.0.0 will bind Libresonic to all available network interfaces. REM The default value 0.0.0.0 will bind Libresonic to all available network interfaces.
set SUBSONIC_HOST=0.0.0.0 set LIBRESONIC_HOST=0.0.0.0
REM The port on which Libresonic will listen for incoming HTTP traffic. REM The port on which Libresonic will listen for incoming HTTP traffic.
set SUBSONIC_PORT=4040 set LIBRESONIC_PORT=4040
REM The port on which Libresonic will listen for incoming HTTPS traffic (0 to disable). REM The port on which Libresonic will listen for incoming HTTPS traffic (0 to disable).
set SUBSONIC_HTTPS_PORT=0 set LIBRESONIC_HTTPS_PORT=0
REM The context path (i.e., the last part of the Libresonic URL). Typically "/" or "/libresonic". REM The context path (i.e., the last part of the Libresonic URL). Typically "/" or "/libresonic".
set SUBSONIC_CONTEXT_PATH=/ set LIBRESONIC_CONTEXT_PATH=/
REM The memory limit (max Java heap size) in megabytes. REM The memory limit (max Java heap size) in megabytes.
set MAX_MEMORY=150 set MAX_MEMORY=150
java -Xmx%MAX_MEMORY%m -Dlibresonic.home=%SUBSONIC_HOME% -Dlibresonic.host=%SUBSONIC_HOST% -Dlibresonic.port=%SUBSONIC_PORT% -Dlibresonic.httpsPort=%SUBSONIC_HTTPS_PORT% -Dlibresonic.contextPath=%SUBSONIC_CONTEXT_PATH% -jar libresonic-booter-jar-with-dependencies.jar java -Xmx%MAX_MEMORY%m -Dlibresonic.home=%LIBRESONIC_HOME% -Dlibresonic.host=%LIBRESONIC_HOST% -Dlibresonic.port=%LIBRESONIC_PORT% -Dlibresonic.httpsPort=%LIBRESONIC_HTTPS_PORT% -Dlibresonic.contextPath=%LIBRESONIC_CONTEXT_PATH% -jar libresonic-booter-jar-with-dependencies.jar

@ -6,16 +6,16 @@
# Author: Sindre Mehus # Author: Sindre Mehus
################################################################################### ###################################################################################
SUBSONIC_HOME=/var/libresonic LIBRESONIC_HOME=/var/libresonic
SUBSONIC_HOST=0.0.0.0 LIBRESONIC_HOST=0.0.0.0
SUBSONIC_PORT=4040 LIBRESONIC_PORT=4040
SUBSONIC_HTTPS_PORT=0 LIBRESONIC_HTTPS_PORT=0
SUBSONIC_CONTEXT_PATH=/ LIBRESONIC_CONTEXT_PATH=/
SUBSONIC_MAX_MEMORY=150 LIBRESONIC_MAX_MEMORY=150
SUBSONIC_PIDFILE= LIBRESONIC_PIDFILE=
SUBSONIC_DEFAULT_MUSIC_FOLDER=/var/music LIBRESONIC_DEFAULT_MUSIC_FOLDER=/var/music
SUBSONIC_DEFAULT_PODCAST_FOLDER=/var/music/Podcast LIBRESONIC_DEFAULT_PODCAST_FOLDER=/var/music/Podcast
SUBSONIC_DEFAULT_PLAYLIST_FOLDER=/var/playlists LIBRESONIC_DEFAULT_PLAYLIST_FOLDER=/var/playlists
quiet=0 quiet=0
@ -54,37 +54,37 @@ while [ $# -ge 1 ]; do
usage usage
;; ;;
--home=?*) --home=?*)
SUBSONIC_HOME=${1#--home=} LIBRESONIC_HOME=${1#--home=}
;; ;;
--host=?*) --host=?*)
SUBSONIC_HOST=${1#--host=} LIBRESONIC_HOST=${1#--host=}
;; ;;
--port=?*) --port=?*)
SUBSONIC_PORT=${1#--port=} LIBRESONIC_PORT=${1#--port=}
;; ;;
--https-port=?*) --https-port=?*)
SUBSONIC_HTTPS_PORT=${1#--https-port=} LIBRESONIC_HTTPS_PORT=${1#--https-port=}
;; ;;
--context-path=?*) --context-path=?*)
SUBSONIC_CONTEXT_PATH=${1#--context-path=} LIBRESONIC_CONTEXT_PATH=${1#--context-path=}
;; ;;
--max-memory=?*) --max-memory=?*)
SUBSONIC_MAX_MEMORY=${1#--max-memory=} LIBRESONIC_MAX_MEMORY=${1#--max-memory=}
;; ;;
--pidfile=?*) --pidfile=?*)
SUBSONIC_PIDFILE=${1#--pidfile=} LIBRESONIC_PIDFILE=${1#--pidfile=}
;; ;;
--quiet) --quiet)
quiet=1 quiet=1
;; ;;
--default-music-folder=?*) --default-music-folder=?*)
SUBSONIC_DEFAULT_MUSIC_FOLDER=${1#--default-music-folder=} LIBRESONIC_DEFAULT_MUSIC_FOLDER=${1#--default-music-folder=}
;; ;;
--default-podcast-folder=?*) --default-podcast-folder=?*)
SUBSONIC_DEFAULT_PODCAST_FOLDER=${1#--default-podcast-folder=} LIBRESONIC_DEFAULT_PODCAST_FOLDER=${1#--default-podcast-folder=}
;; ;;
--default-playlist-folder=?*) --default-playlist-folder=?*)
SUBSONIC_DEFAULT_PLAYLIST_FOLDER=${1#--default-playlist-folder=} LIBRESONIC_DEFAULT_PLAYLIST_FOLDER=${1#--default-playlist-folder=}
;; ;;
*) *)
usage usage
@ -101,8 +101,8 @@ if [ -e "${JAVA_HOME}" ]
fi fi
# Create Libresonic home directory. # Create Libresonic home directory.
mkdir -p ${SUBSONIC_HOME} mkdir -p ${LIBRESONIC_HOME}
LOG=${SUBSONIC_HOME}/libresonic_sh.log LOG=${LIBRESONIC_HOME}/libresonic_sh.log
rm -f ${LOG} rm -f ${LOG}
cd $(dirname $0) cd $(dirname $0)
@ -110,22 +110,22 @@ if [ -L $0 ] && ([ -e /bin/readlink ] || [ -e /usr/bin/readlink ]); then
cd $(dirname $(readlink $0)) cd $(dirname $(readlink $0))
fi fi
${JAVA} -Xmx${SUBSONIC_MAX_MEMORY}m \ ${JAVA} -Xmx${LIBRESONIC_MAX_MEMORY}m \
-Dlibresonic.home=${SUBSONIC_HOME} \ -Dlibresonic.home=${LIBRESONIC_HOME} \
-Dlibresonic.host=${SUBSONIC_HOST} \ -Dlibresonic.host=${LIBRESONIC_HOST} \
-Dlibresonic.port=${SUBSONIC_PORT} \ -Dlibresonic.port=${LIBRESONIC_PORT} \
-Dlibresonic.httpsPort=${SUBSONIC_HTTPS_PORT} \ -Dlibresonic.httpsPort=${LIBRESONIC_HTTPS_PORT} \
-Dlibresonic.contextPath=${SUBSONIC_CONTEXT_PATH} \ -Dlibresonic.contextPath=${LIBRESONIC_CONTEXT_PATH} \
-Dlibresonic.defaultMusicFolder=${SUBSONIC_DEFAULT_MUSIC_FOLDER} \ -Dlibresonic.defaultMusicFolder=${LIBRESONIC_DEFAULT_MUSIC_FOLDER} \
-Dlibresonic.defaultPodcastFolder=${SUBSONIC_DEFAULT_PODCAST_FOLDER} \ -Dlibresonic.defaultPodcastFolder=${LIBRESONIC_DEFAULT_PODCAST_FOLDER} \
-Dlibresonic.defaultPlaylistFolder=${SUBSONIC_DEFAULT_PLAYLIST_FOLDER} \ -Dlibresonic.defaultPlaylistFolder=${LIBRESONIC_DEFAULT_PLAYLIST_FOLDER} \
-Djava.awt.headless=true \ -Djava.awt.headless=true \
-verbose:gc \ -verbose:gc \
-jar libresonic-booter-jar-with-dependencies.jar > ${LOG} 2>&1 & -jar libresonic-booter-jar-with-dependencies.jar > ${LOG} 2>&1 &
# Write pid to pidfile if it is defined. # Write pid to pidfile if it is defined.
if [ $SUBSONIC_PIDFILE ]; then if [ $LIBRESONIC_PIDFILE ]; then
echo $! > ${SUBSONIC_PIDFILE} echo $! > ${LIBRESONIC_PIDFILE}
fi fi
if [ $quiet = 0 ]; then if [ $quiet = 0 ]; then

@ -3,7 +3,7 @@
# (/etc/init.d/libresonic) # (/etc/init.d/libresonic)
# #
# To change the startup parameters of Libresonic, modify # To change the startup parameters of Libresonic, modify
# the SUBSONIC_ARGS variable below. # the LIBRESONIC_ARGS variable below.
# #
# Type "/usr/share/libresonic/libresonic.sh --help" on the command line to read an # Type "/usr/share/libresonic/libresonic.sh --help" on the command line to read an
# explanation of the different options. # explanation of the different options.
@ -12,9 +12,9 @@
# and 443 (for https), and use a Java memory heap size of 200 MB, use # and 443 (for https), and use a Java memory heap size of 200 MB, use
# the following: # the following:
# #
# SUBSONIC_ARGS="--port=80 --https-port=443 --max-memory=200" # LIBRESONIC_ARGS="--port=80 --https-port=443 --max-memory=200"
SUBSONIC_ARGS="--max-memory=150" LIBRESONIC_ARGS="--max-memory=150"
# The user which should run the Libresonic process. Default "root". # The user which should run the Libresonic process. Default "root".
@ -22,4 +22,4 @@ SUBSONIC_ARGS="--max-memory=150"
# below 1024. Also make sure to grant the user write permissions in # below 1024. Also make sure to grant the user write permissions in
# the music directories, otherwise changing album art and tags will fail. # the music directories, otherwise changing album art and tags will fail.
SUBSONIC_USER=root LIBRESONIC_USER=root

@ -22,14 +22,14 @@ DESC="Libresonic Daemon"
NAME=libresonic NAME=libresonic
PIDFILE=/var/run/$NAME.pid PIDFILE=/var/run/$NAME.pid
DAEMON=/usr/bin/$NAME DAEMON=/usr/bin/$NAME
DAEMON_ARGS="--pidfile=$PIDFILE $SUBSONIC_ARGS" DAEMON_ARGS="--pidfile=$PIDFILE $LIBRESONIC_ARGS"
SCRIPTNAME=/etc/init.d/$NAME SCRIPTNAME=/etc/init.d/$NAME
# Exit if the package is not installed # Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0 [ -x "$DAEMON" ] || exit 0
# Run as root if SUBSONIC_USER is not set. # Run as root if LIBRESONIC_USER is not set.
[ "$SUBSONIC_USER" = "" ] && SUBSONIC_USER=root [ "$LIBRESONIC_USER" = "" ] && LIBRESONIC_USER=root
# Make sure Libresonic is started with system locale # Make sure Libresonic is started with system locale
if [ -r /etc/default/locale ]; then if [ -r /etc/default/locale ]; then
@ -61,11 +61,11 @@ do_start()
fi fi
touch $PIDFILE touch $PIDFILE
chown $SUBSONIC_USER $PIDFILE chown $LIBRESONIC_USER $PIDFILE
[ -e /var/libresonic ] && chown -R $SUBSONIC_USER /var/libresonic [ -e /var/libresonic ] && chown -R $LIBRESONIC_USER /var/libresonic
[ -e /tmp/libresonic ] && chown -R $SUBSONIC_USER /tmp/libresonic [ -e /tmp/libresonic ] && chown -R $LIBRESONIC_USER /tmp/libresonic
start-stop-daemon --start -c $SUBSONIC_USER --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_ARGS || return 2 start-stop-daemon --start -c $LIBRESONIC_USER --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_ARGS || return 2
} }
# #

@ -1,13 +1,13 @@
#!/bin/bash #!/bin/bash
SUBSONIC_HOME="/Library/Application Support/Libresonic" LIBRESONIC_HOME="/Library/Application Support/Libresonic"
chmod oug+rwx "$SUBSONIC_HOME" chmod oug+rwx "$LIBRESONIC_HOME"
chown root:admin "$SUBSONIC_HOME" chown root:admin "$LIBRESONIC_HOME"
chmod oug+rx "$SUBSONIC_HOME/transcode" chmod oug+rx "$LIBRESONIC_HOME/transcode"
chown root:admin "$SUBSONIC_HOME/transcode" chown root:admin "$LIBRESONIC_HOME/transcode"
rm -rf "$SUBSONIC_HOME/jetty" rm -rf "$LIBRESONIC_HOME/jetty"
echo Libresonic installation done echo Libresonic installation done

@ -1,11 +1,11 @@
#!/bin/bash #!/bin/bash
SUBSONIC_HOME="/Library/Application Support/Libresonic" LIBRESONIC_HOME="/Library/Application Support/Libresonic"
# Backup database. # Backup database.
if [ -e "$SUBSONIC_HOME/db" ]; then if [ -e "$LIBRESONIC_HOME/db" ]; then
rm -rf "$SUBSONIC_HOME/db.backup" rm -rf "$LIBRESONIC_HOME/db.backup"
cp -R "$SUBSONIC_HOME/db" "$SUBSONIC_HOME/db.backup" cp -R "$LIBRESONIC_HOME/db" "$LIBRESONIC_HOME/db.backup"
fi fi

@ -28,14 +28,14 @@ NAME=libresonic
PIDFILE=/var/run/$NAME.pid PIDFILE=/var/run/$NAME.pid
LOCKFILE=/var/lock/subsys/$NAME LOCKFILE=/var/lock/subsys/$NAME
DAEMON=/usr/bin/$NAME DAEMON=/usr/bin/$NAME
DAEMON_ARGS="--pidfile=$PIDFILE $SUBSONIC_ARGS" DAEMON_ARGS="--pidfile=$PIDFILE $LIBRESONIC_ARGS"
SCRIPTNAME=/etc/init.d/$NAME SCRIPTNAME=/etc/init.d/$NAME
# Exit if the package is not installed. # Exit if the package is not installed.
[ -x "$DAEMON" ] || exit 0 [ -x "$DAEMON" ] || exit 0
# Run as root if SUBSONIC_USER is not set. # Run as root if LIBRESONIC_USER is not set.
[ "$SUBSONIC_USER" = "" ] && SUBSONIC_USER=root [ "$LIBRESONIC_USER" = "" ] && LIBRESONIC_USER=root
# Source function library. # Source function library.
. /etc/init.d/functions . /etc/init.d/functions
@ -53,12 +53,12 @@ do_start()
fi fi
touch $PIDFILE touch $PIDFILE
chown $SUBSONIC_USER $PIDFILE chown $LIBRESONIC_USER $PIDFILE
[ -e /var/libresonic ] && chown -R $SUBSONIC_USER /var/libresonic [ -e /var/libresonic ] && chown -R $LIBRESONIC_USER /var/libresonic
[ -e /tmp/libresonic ] && chown -R $SUBSONIC_USER /tmp/libresonic [ -e /tmp/libresonic ] && chown -R $LIBRESONIC_USER /tmp/libresonic
echo $"Starting $NAME ..." echo $"Starting $NAME ..."
su -c "$DAEMON $DAEMON_ARGS" $SUBSONIC_USER su -c "$DAEMON $DAEMON_ARGS" $LIBRESONIC_USER
RETVAL=$? RETVAL=$?
echo echo
[ $RETVAL -eq 0 ] && touch $LOCKFILE [ $RETVAL -eq 0 ] && touch $LOCKFILE

@ -3,7 +3,7 @@
# (/etc/init.d/libresonic) # (/etc/init.d/libresonic)
# #
# To change the startup parameters of Libresonic, modify # To change the startup parameters of Libresonic, modify
# the SUBSONIC_ARGS variable below. # the LIBRESONIC_ARGS variable below.
# #
# Type "/usr/share/libresonic/libresonic.sh --help" on the command line to read an # Type "/usr/share/libresonic/libresonic.sh --help" on the command line to read an
# explanation of the different options. # explanation of the different options.
@ -12,9 +12,9 @@
# and 443 (for https), and use a Java memory heap size of 200 MB, use # and 443 (for https), and use a Java memory heap size of 200 MB, use
# the following: # the following:
# #
# SUBSONIC_ARGS="--port=80 --https-port=443 --max-memory=200" # LIBRESONIC_ARGS="--port=80 --https-port=443 --max-memory=200"
SUBSONIC_ARGS="--max-memory=150" LIBRESONIC_ARGS="--max-memory=150"
# The user which should run the Libresonic process. Default "root". # The user which should run the Libresonic process. Default "root".
@ -22,4 +22,4 @@ SUBSONIC_ARGS="--max-memory=150"
# below 1024. Also make sure to grant the user write permissions in # below 1024. Also make sure to grant the user write permissions in
# the music directories, otherwise changing album art and tags will fail. # the music directories, otherwise changing album art and tags will fail.
SUBSONIC_USER=root LIBRESONIC_USER=root

@ -29,7 +29,7 @@ import java.text.*;
import java.util.*; import java.util.*;
/** /**
* Logger implementation which logs to SUBSONIC_HOME/libresonic.log. * Logger implementation which logs to LIBRESONIC_HOME/libresonic.log.
* <br/> * <br/>
* Note: Third party logging libraries (such as log4j and Commons logging) are intentionally not * Note: Third party logging libraries (such as log4j and Commons logging) are intentionally not
* used. These libraries causes a lot of headache when deploying to some application servers * used. These libraries causes a lot of headache when deploying to some application servers

@ -163,7 +163,7 @@ public class StreamController implements Controller {
response.setContentType(StringUtil.getMimeType("ts")); // HLS is always MPEG TS. response.setContentType(StringUtil.getMimeType("ts")); // HLS is always MPEG TS.
} else { } else {
String transcodedSuffix = transcodingService.getSuffix(player, file, preferredTargetFormat); String transcodedSuffix = transcodingService.getSuffix(player, file, preferredTargetFormat);
boolean sonos = SonosHelper.SUBSONIC_CLIENT_ID.equals(player.getClientId()); boolean sonos = SonosHelper.LIBRESONIC_CLIENT_ID.equals(player.getClientId());
response.setContentType(StringUtil.getMimeType(transcodedSuffix, sonos)); response.setContentType(StringUtil.getMimeType(transcodedSuffix, sonos));
setContentDuration(response, file); setContentDuration(response, file);
} }

@ -124,7 +124,7 @@ public class PlayQueueInputStream extends InputStream {
mediaFileService.incrementPlayCount(file); mediaFileService.incrementPlayCount(file);
// Don't scrobble REST players (except Sonos) // Don't scrobble REST players (except Sonos)
if (player.getClientId() == null || player.getClientId().equals(SonosHelper.SUBSONIC_CLIENT_ID)) { if (player.getClientId() == null || player.getClientId().equals(SonosHelper.LIBRESONIC_CLIENT_ID)) {
audioScrobblerService.register(file, player.getUsername(), false, null); audioScrobblerService.register(file, player.getUsername(), false, null);
} }
@ -149,7 +149,7 @@ public class PlayQueueInputStream extends InputStream {
} }
} finally { } finally {
// Don't scrobble REST players (except Sonos) // Don't scrobble REST players (except Sonos)
if (player.getClientId() == null || player.getClientId().equals(SonosHelper.SUBSONIC_CLIENT_ID)) { if (player.getClientId() == null || player.getClientId().equals(SonosHelper.LIBRESONIC_CLIENT_ID)) {
audioScrobblerService.register(currentFile, player.getUsername(), true, null); audioScrobblerService.register(currentFile, player.getUsername(), true, null);
} }
currentInputStream = null; currentInputStream = null;

@ -76,8 +76,8 @@ import org.libresonic.player.util.Util;
public class SettingsService { public class SettingsService {
// Libresonic home directory. // Libresonic home directory.
private static final File SUBSONIC_HOME_WINDOWS = new File("c:/libresonic"); private static final File LIBRESONIC_HOME_WINDOWS = new File("c:/libresonic");
private static final File SUBSONIC_HOME_OTHER = new File("/var/libresonic"); private static final File LIBRESONIC_HOME_OTHER = new File("/var/libresonic");
// Number of free trial days. // Number of free trial days.
public static final long TRIAL_DAYS = 30L; public static final long TRIAL_DAYS = 30L;
@ -341,7 +341,7 @@ public class SettingsService {
home = new File(overrideHome); home = new File(overrideHome);
} else { } else {
boolean isWindows = System.getProperty("os.name", "Windows").toLowerCase().startsWith("windows"); boolean isWindows = System.getProperty("os.name", "Windows").toLowerCase().startsWith("windows");
home = isWindows ? SUBSONIC_HOME_WINDOWS : SUBSONIC_HOME_OTHER; home = isWindows ? LIBRESONIC_HOME_WINDOWS : LIBRESONIC_HOME_OTHER;
} }
// Attempt to create home directory if it doesn't exist. // Attempt to create home directory if it doesn't exist.

@ -246,8 +246,8 @@ public class VersionService {
} }
BufferedReader reader = new BufferedReader(new StringReader(content)); BufferedReader reader = new BufferedReader(new StringReader(content));
Pattern finalPattern = Pattern.compile("SUBSONIC_FULL_VERSION_BEGIN(.*)SUBSONIC_FULL_VERSION_END"); Pattern finalPattern = Pattern.compile("LIBRESONIC_FULL_VERSION_BEGIN(.*)LIBRESONIC_FULL_VERSION_END");
Pattern betaPattern = Pattern.compile("SUBSONIC_BETA_VERSION_BEGIN(.*)SUBSONIC_BETA_VERSION_END"); Pattern betaPattern = Pattern.compile("LIBRESONIC_BETA_VERSION_BEGIN(.*)LIBRESONIC_BETA_VERSION_END");
try { try {
String line = reader.readLine(); String line = reader.readLine();

@ -78,7 +78,7 @@ import org.libresonic.player.util.Util;
*/ */
public class SonosHelper { public class SonosHelper {
public static final String SUBSONIC_CLIENT_ID = "sonos"; public static final String LIBRESONIC_CLIENT_ID = "sonos";
private MediaFileService mediaFileService; private MediaFileService mediaFileService;
private PlaylistService playlistService; private PlaylistService playlistService;
@ -674,17 +674,17 @@ public class SonosHelper {
} }
private Player createPlayerIfNecessary(String username) { private Player createPlayerIfNecessary(String username) {
List<Player> players = playerService.getPlayersForUserAndClientId(username, SUBSONIC_CLIENT_ID); List<Player> players = playerService.getPlayersForUserAndClientId(username, LIBRESONIC_CLIENT_ID);
// If not found, create it. // If not found, create it.
if (players.isEmpty()) { if (players.isEmpty()) {
Player player = new Player(); Player player = new Player();
player.setUsername(username); player.setUsername(username);
player.setClientId(SUBSONIC_CLIENT_ID); player.setClientId(LIBRESONIC_CLIENT_ID);
player.setName("Sonos"); player.setName("Sonos");
player.setTechnology(PlayerTechnology.EXTERNAL_WITH_PLAYLIST); player.setTechnology(PlayerTechnology.EXTERNAL_WITH_PLAYLIST);
playerService.createPlayer(player); playerService.createPlayer(player);
players = playerService.getPlayersForUserAndClientId(username, SUBSONIC_CLIENT_ID); players = playerService.getPlayersForUserAndClientId(username, LIBRESONIC_CLIENT_ID);
} }
return players.get(0); return players.get(0);

@ -33,19 +33,19 @@ import junit.framework.TestCase;
*/ */
public class SettingsServiceTestCase extends TestCase { public class SettingsServiceTestCase extends TestCase {
private static final File SUBSONIC_HOME = new File("/tmp/libresonic"); private static final File LIBRESONIC_HOME = new File("/tmp/libresonic");
private SettingsService settingsService; private SettingsService settingsService;
@Override @Override
protected void setUp() throws Exception { protected void setUp() throws Exception {
System.setProperty("libresonic.home", SUBSONIC_HOME.getPath()); System.setProperty("libresonic.home", LIBRESONIC_HOME.getPath());
new File(SUBSONIC_HOME, "libresonic.properties").delete(); new File(LIBRESONIC_HOME, "libresonic.properties").delete();
settingsService = new SettingsService(); settingsService = new SettingsService();
} }
public void testLibresonicHome() { public void testLibresonicHome() {
assertEquals("Wrong Libresonic home.", SUBSONIC_HOME, SettingsService.getLibresonicHome()); assertEquals("Wrong Libresonic home.", LIBRESONIC_HOME, SettingsService.getLibresonicHome());
} }
public void testDefaultValues() { public void testDefaultValues() {

@ -1,5 +1,5 @@
========================================================== ==========================================================
SUBSONIC TRANSCODING PACK LIBRESONIC TRANSCODING PACK
========================================================== ==========================================================
This is a collection of free audio codecs for Windows. This is a collection of free audio codecs for Windows.

Loading…
Cancel
Save