Files
LibreELEC.tv/packages/addons/service/librespot/source/bin/librespot.start
2019-08-08 13:35:13 +02:00

38 lines
979 B
Bash
Executable File

#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
. /etc/profile
oe_setup_addon service.librespot
PORT="6666"
SINK_NAME="librespot_sink"
if ! pactl list modules short | grep "sink_name=$SINK_NAME"; then
pactl load-module module-null-sink sink_name="$SINK_NAME" > /dev/null
fi
if ! pactl list modules short | grep "source=$SINK_NAME"; then
pactl load-module module-rtp-send source="$SINK_NAME.monitor" \
destination_ip=127.0.0.1 port="$PORT" source_ip=127.0.0.1 > /dev/null
fi
pactl suspend-sink "$SINK_NAME" 1
LIBRESPOT="librespot \
--backend pulseaudio \
--bitrate 320 \
--cache \"$ADDON_HOME/cache\" \
--device-type TV \
--disable-audio-cache \
--name \"Kodi ($HOSTNAME)\" \
--notify-kodi"
if [ "$ls_a" = "true" -a -n "$ls_p" -a -n "$ls_u" ]; then
LIBRESPOT="$LIBRESPOT \
--disable-discovery \
--password \"$ls_p\" \
--username \"$ls_u\""
fi
eval $LIBRESPOT