mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-28 13:16:41 +00:00
Merge pull request #1720 from awiouy/remove-scw-8.2
spotify-connect-web: remove addon
This commit is contained in:
commit
7d3bb1f892
@ -1,19 +0,0 @@
|
|||||||
8.0.103
|
|
||||||
- Handle PCM specified as a:CARD=c,DEV=d
|
|
||||||
|
|
||||||
8.0.102
|
|
||||||
- Add passwordless/mutiuser login
|
|
||||||
|
|
||||||
8.0.101
|
|
||||||
- Use mixer card index
|
|
||||||
- Add instructions to the addon settings
|
|
||||||
- Add a configuration wizard to assist with ALSA configuration
|
|
||||||
- Enable setting initial volume
|
|
||||||
- Activate onboard audio interface if no audio interface is active
|
|
||||||
- Activate known audio interface if selected but inactive
|
|
||||||
- Only set the playback route for RPi2 onboard audio interface
|
|
||||||
- Remove default settings
|
|
||||||
- Fix the erroneous bit rate setting
|
|
||||||
|
|
||||||
8.0.100
|
|
||||||
- Initial addon
|
|
Binary file not shown.
Before Width: | Height: | Size: 26 KiB |
@ -1,55 +0,0 @@
|
|||||||
################################################################################
|
|
||||||
# This file is part of LibreELEC - https://libreelec.tv
|
|
||||||
# Copyright (C) 2016 Team LibreELEC
|
|
||||||
#
|
|
||||||
# LibreELEC is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 2 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# LibreELEC is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
PKG_NAME="spotify-connect-web"
|
|
||||||
PKG_VERSION="0.0.3-alpha"
|
|
||||||
PKG_REV="103"
|
|
||||||
PKG_ARCH="arm"
|
|
||||||
PKG_ADDON_PROJECTS="RPi2 WeTek_Core WeTek_Play"
|
|
||||||
PKG_LICENSE="prop."
|
|
||||||
PKG_SITE="https://github.com/Fornoth/spotify-connect-web"
|
|
||||||
PKG_URL="https://github.com/Fornoth/spotify-connect-web/releases/download/$PKG_VERSION/${PKG_NAME}_$PKG_VERSION.tar.gz"
|
|
||||||
PKG_SOURCE_DIR="spotify-connect-web"
|
|
||||||
PKG_DEPENDS_TARGET="toolchain avahi"
|
|
||||||
PKG_SECTION="service"
|
|
||||||
PKG_SHORTDESC="Spotify Connect Web: play Spotify through LibreELEC"
|
|
||||||
PKG_LONGDESC="Spotify Connect Web ($PKG_VERSION) plays Spotify through LibreELEC, using a Spotify app as a remote."
|
|
||||||
PKG_AUTORECONF="no"
|
|
||||||
|
|
||||||
PKG_IS_ADDON="yes"
|
|
||||||
PKG_ADDON_NAME="Spotify Connect Web"
|
|
||||||
PKG_ADDON_TYPE="xbmc.service"
|
|
||||||
PKG_MAINTAINER="Anton Voyl (awiouy)"
|
|
||||||
|
|
||||||
make_target() {
|
|
||||||
: # nop
|
|
||||||
}
|
|
||||||
|
|
||||||
makeinstall_target() {
|
|
||||||
: # nop
|
|
||||||
}
|
|
||||||
|
|
||||||
addon() {
|
|
||||||
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/bin
|
|
||||||
|
|
||||||
cp -P $(get_build_dir avahi)/avahi-utils/.libs/avahi-publish \
|
|
||||||
$ADDON_BUILD/$PKG_ADDON_ID/bin/
|
|
||||||
|
|
||||||
cp -PR $PKG_BUILD/* $ADDON_BUILD/$PKG_ADDON_ID/
|
|
||||||
rm $ADDON_BUILD/$PKG_ADDON_ID/libasound.so.2
|
|
||||||
}
|
|
@ -1,120 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
################################################################################
|
|
||||||
# This file is part of LibreELEC - https://libreelec.tv
|
|
||||||
# Copyright (C) 2016 Team LibreELEC
|
|
||||||
#
|
|
||||||
# LibreELEC is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 2 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# LibreELEC is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
. /etc/os-release
|
|
||||||
. /etc/profile
|
|
||||||
oe_setup_addon service.spotify-connect-web
|
|
||||||
|
|
||||||
chmod +x "$ADDON_DIR/spotify-connect-web"
|
|
||||||
mkdir -p "$ADDON_HOME"
|
|
||||||
|
|
||||||
activate_card() {
|
|
||||||
if [ -e "/proc/asound/$1" ]
|
|
||||||
then
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
if [ "$LIBREELEC_ARCH" == "RPi2.arm" -a "$1" == "ALSA" ]
|
|
||||||
then
|
|
||||||
dtparam audio=on
|
|
||||||
sleep 1
|
|
||||||
else
|
|
||||||
echo "Do not know how to activate card $1 on $LIBREELEC_ARCH"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ ! "$(cat /proc/asound/pcm 2> /dev/null)" ]
|
|
||||||
then
|
|
||||||
if [ "$LIBREELEC_ARCH" == "RPi2.arm" ]
|
|
||||||
then
|
|
||||||
activate_card "ALSA"
|
|
||||||
else
|
|
||||||
echo "Do not how how to activate an audio interface on $LIBREELEC_ARCH"
|
|
||||||
ko="ko"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f "$ADDON_HOME/spotify_appkey.key" ]
|
|
||||||
then
|
|
||||||
echo "Key not found"
|
|
||||||
ko="ko"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! "$scw_o" ]
|
|
||||||
then
|
|
||||||
echo "Playback device not set"
|
|
||||||
ko="ko"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$ko" ]
|
|
||||||
then
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "$scw_o" in
|
|
||||||
|
|
||||||
*:CARD=*)
|
|
||||||
card="${scw_o##*:CARD=}"
|
|
||||||
card="${card%%,*}"
|
|
||||||
activate_card "$card"
|
|
||||||
index="$(readlink /proc/asound/$card)"
|
|
||||||
index="${index##*card}"
|
|
||||||
;;
|
|
||||||
|
|
||||||
hw:*,*)
|
|
||||||
echo "The hw:d,s specification is unreliable, use device:CARD=card instead"
|
|
||||||
index="${scw_o##hw:}"
|
|
||||||
index="${index%%,*}"
|
|
||||||
card="card$index"
|
|
||||||
activate_card "$card"
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo "Unknown playback device specification $swc_o"
|
|
||||||
exit
|
|
||||||
;;
|
|
||||||
|
|
||||||
esac
|
|
||||||
|
|
||||||
[ "$scw_m" ] && [ "$vol_0" ] && amixer -c "$index" set "$scw_m" "$vol_0%"
|
|
||||||
|
|
||||||
if [ "$LIBREELEC_ARCH" == "RPi2.arm" -a \
|
|
||||||
"$(readlink /proc/asound/ALSA)" == "card$index" ]
|
|
||||||
then
|
|
||||||
[ "$pcm_3" ] && amixer -c "$index" cset name="PCM Playback Route" "$pcm_3"
|
|
||||||
fi
|
|
||||||
|
|
||||||
avahi-publish -s \
|
|
||||||
TestConnect _spotify-connect._tcp 4000 VERSION=1.0 CPath=/login/_zeroconf &
|
|
||||||
|
|
||||||
[ "$scw_b" == "-" ] && scw_b=""
|
|
||||||
[ "$scw_b" ] && scw_b="-b $scw_b"
|
|
||||||
[ "$scw_m" ] && scw_m="-m $scw_m"
|
|
||||||
[ "$scw_p" ] && [ "$scw_u" ] && scw_p="-p $scw_p" && scw_u="-u $scw_u"
|
|
||||||
|
|
||||||
cd "$ADDON_DIR"
|
|
||||||
./spotify-connect-web $scw_b \
|
|
||||||
-c "$ADDON_HOME/credentials.json" \
|
|
||||||
-k "$ADDON_HOME/spotify_appkey.key" \
|
|
||||||
$scw_m \
|
|
||||||
-n "$HOSTNAME" \
|
|
||||||
-o "$scw_o" \
|
|
||||||
$scw_p \
|
|
||||||
$scw_u \
|
|
||||||
--mixer_device_index "$index"
|
|
@ -1,35 +0,0 @@
|
|||||||
################################################################################
|
|
||||||
# This file is part of LibreELEC - https://libreelec.tv
|
|
||||||
# Copyright (C) 2016 Team LibreELEC
|
|
||||||
#
|
|
||||||
# LibreELEC is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 2 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# LibreELEC is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
import subprocess
|
|
||||||
import xbmc
|
|
||||||
import xbmcaddon
|
|
||||||
|
|
||||||
|
|
||||||
class Monitor(xbmc.Monitor):
|
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
|
||||||
xbmc.Monitor.__init__(self)
|
|
||||||
self.id = xbmcaddon.Addon().getAddonInfo('id')
|
|
||||||
|
|
||||||
def onSettingsChanged(self):
|
|
||||||
subprocess.call(['systemctl', 'restart', self.id])
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
Monitor().waitForAbort()
|
|
@ -1,116 +0,0 @@
|
|||||||
# Kodi Media Center language file
|
|
||||||
# Addon Name: spotify-connect-web
|
|
||||||
msgid ""
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgctxt "#30100"
|
|
||||||
msgid "Configuration"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgctxt "#30101"
|
|
||||||
msgid "Spotify"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgctxt "#30102"
|
|
||||||
msgid "Username (optional)"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgctxt "#30103"
|
|
||||||
msgid "Password"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgctxt "#30104"
|
|
||||||
msgid "Bit rate"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgctxt "#30105"
|
|
||||||
msgid "-"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgctxt "#30106"
|
|
||||||
msgid "90"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgctxt "#30107"
|
|
||||||
msgid "160"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgctxt "#30108"
|
|
||||||
msgid "320"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgctxt "#30109"
|
|
||||||
msgid "ALSA"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgctxt "#30110"
|
|
||||||
msgid "Configuration wizard"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgctxt "#30111"
|
|
||||||
msgid "Playback device"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgctxt "#30112"
|
|
||||||
msgid "Mixer"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgctxt "#30113"
|
|
||||||
msgid "Initial volume"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgctxt "#30114"
|
|
||||||
msgid "Playback route"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgctxt "#30115"
|
|
||||||
msgid "auto detect"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgctxt "#30116"
|
|
||||||
msgid "headphone jack"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgctxt "#30117"
|
|
||||||
msgid "HDMI"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgctxt "#30200"
|
|
||||||
msgid "Instructions"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgctxt "#30201"
|
|
||||||
msgid "1. Copy your spofify_appkey.key the addon's home folder"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgctxt "#30202"
|
|
||||||
msgid "2. Optionally enter your Spotify username and password"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgctxt "#30203"
|
|
||||||
msgid "3. Configure ALSA with the wizard"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgctxt "#30204"
|
|
||||||
msgid "4. Save the settings"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgctxt "#30205"
|
|
||||||
msgid "5. Check the service with the web interface at port 4000"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgctxt "#30206"
|
|
||||||
msgid "6. Play Spotify through the service, using a Spotify app as a remote"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgctxt "#30207"
|
|
||||||
msgid "7. Enjoy!"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgctxt "#30210"
|
|
||||||
msgid "No playback device"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgctxt "#30211"
|
|
||||||
msgid "Could not find a playback device"
|
|
||||||
msgstr ""
|
|
@ -1,27 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
|
||||||
<settings>
|
|
||||||
<category label="30100" >
|
|
||||||
<setting label="30101" type="lsep" />
|
|
||||||
<setting label="30102" type="text" id="scw_u" />
|
|
||||||
<setting label="30103" type="text" id="scw_p" option="hidden"
|
|
||||||
visible="!eq(-1,)" />
|
|
||||||
<setting label="30104" type="labelenum" id="scw_b" lvalues="30105|30106|30107|30108" />
|
|
||||||
<setting label="30109" type="lsep" />
|
|
||||||
<setting label="30110" type="action" action="RunScript(/storage/.kodi/addons/service.spotify-connect-web/wizard.py)" />
|
|
||||||
<setting label="30111" type="text" id="scw_o" default=""/>
|
|
||||||
<setting label="30112" type="text" id="scw_m" default="" />
|
|
||||||
<setting label="30113" type="slider" id="vol_0" default="80" range="0,10,100" option="percent"
|
|
||||||
visible="!eq(-1,)" />
|
|
||||||
<setting label="30114" type="enum" id="pcm_3" lvalues="30115|30116|30117"
|
|
||||||
visible="eq(-3,default:CARD=ALSA) | eq(-3,sysdefault:CARD=ALSA)" />
|
|
||||||
</category>
|
|
||||||
<category label="30200" >
|
|
||||||
<setting label="30201" type="lsep" />
|
|
||||||
<setting label="30202" type="lsep" />
|
|
||||||
<setting label="30203" type="lsep" />
|
|
||||||
<setting label="30204" type="lsep" />
|
|
||||||
<setting label="30205" type="lsep" />
|
|
||||||
<setting label="30206" type="lsep" />
|
|
||||||
<setting label="30207" type="lsep" />
|
|
||||||
</category>
|
|
||||||
</settings>
|
|
@ -1,11 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=spotify-connect-web
|
|
||||||
After=network-online.target
|
|
||||||
Requires=network-online.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
ExecStart=/bin/sh /storage/.kodi/addons/service.spotify-connect-web/bin/spotify-connect-web.start
|
|
||||||
Restart=on-failure
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=kodi.target
|
|
@ -1,53 +0,0 @@
|
|||||||
################################################################################
|
|
||||||
# This file is part of LibreELEC - https://libreelec.tv
|
|
||||||
# Copyright (C) 2016 Team LibreELEC
|
|
||||||
#
|
|
||||||
# LibreELEC is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 2 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# LibreELEC is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
import alsaaudio as alsa
|
|
||||||
import xbmcaddon
|
|
||||||
import xbmcgui
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
|
|
||||||
addon = xbmcaddon.Addon("service.spotify-connect-web")
|
|
||||||
dialog = xbmcgui.Dialog()
|
|
||||||
strings = addon.getLocalizedString
|
|
||||||
|
|
||||||
while True:
|
|
||||||
pcms = alsa.pcms()[1:]
|
|
||||||
if len(pcms) == 0:
|
|
||||||
dialog.ok(strings(30210), strings(30211))
|
|
||||||
break
|
|
||||||
pcmx = dialog.select(strings(30111), pcms)
|
|
||||||
if pcmx == -1:
|
|
||||||
break
|
|
||||||
pcm = pcms[pcmx]
|
|
||||||
pair = pcm.split(":CARD=")
|
|
||||||
device = pair[0]
|
|
||||||
card = pair[1].split(",")[0]
|
|
||||||
cardx = alsa.cards().index(card)
|
|
||||||
mixers = [mixer for mixer in alsa.mixers(cardindex=cardx, device=device)
|
|
||||||
if 'Playback Volume' in alsa.Mixer(control=mixer, cardindex=cardx).volumecap()]
|
|
||||||
if len(mixers) == 0:
|
|
||||||
mixer = ""
|
|
||||||
else:
|
|
||||||
mixerx = dialog.select(strings(30112), mixers)
|
|
||||||
if mixerx == -1:
|
|
||||||
continue
|
|
||||||
mixer = mixers[mixerx]
|
|
||||||
addon.setSetting("scw_m", mixer)
|
|
||||||
addon.setSetting("scw_o", pcm)
|
|
||||||
break
|
|
Loading…
x
Reference in New Issue
Block a user