diff --git a/packages/addons/service/spotify-connect-web/changelog.txt b/packages/addons/service/spotify-connect-web/changelog.txt new file mode 100644 index 0000000000..9455e1f3c8 --- /dev/null +++ b/packages/addons/service/spotify-connect-web/changelog.txt @@ -0,0 +1,2 @@ +8.0.100 +- Initial addon diff --git a/packages/addons/service/spotify-connect-web/package.mk b/packages/addons/service/spotify-connect-web/package.mk new file mode 100644 index 0000000000..eb5bdeb162 --- /dev/null +++ b/packages/addons/service/spotify-connect-web/package.mk @@ -0,0 +1,53 @@ +################################################################################ +# 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 . +################################################################################ + +PKG_NAME="spotify-connect-web" +PKG_VERSION="0.0.3-alpha" +PKG_REV="100" +PKG_ARCH="arm" +PKG_ADDON_PROJECTS="RPi2" +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" +PKG_PRIORITY="optional" +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_ADDON_REPOVERSION="8.0" +PKG_MAINTAINER="Anton Voyl (awiouy)" + +make_target() { + : # nop +} + +makeinstall_target() { + : # nop +} + +addon() { + mkdir -p $ADDON_BUILD/$PKG_ADDON_ID + cp -PR $PKG_BUILD/* $ADDON_BUILD/$PKG_ADDON_ID/ + rm $ADDON_BUILD/$PKG_ADDON_ID/libasound.so.2 +} diff --git a/packages/addons/service/spotify-connect-web/source/bin/spotify-connect-web.start b/packages/addons/service/spotify-connect-web/source/bin/spotify-connect-web.start new file mode 100755 index 0000000000..d57f127fe7 --- /dev/null +++ b/packages/addons/service/spotify-connect-web/source/bin/spotify-connect-web.start @@ -0,0 +1,58 @@ +#!/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 . +################################################################################ + +. /etc/profile +oe_setup_addon service.spotify-connect-web + +mkdir -p "$ADDON_HOME" + +if [ ! -f "$ADDON_HOME/spotify_appkey.key" ] +then + echo "Exiting: no key" + exit +fi + +if [ ! "$scw_p" ] +then + echo "Exiting: no password" + exit +fi + +if [ ! "$scw_u" ] +then + echo "Exiting: no username" + exit +fi + +amixer &> /dev/null || dtoverlay dtparam audio=on +amixer cset numid=3 "$pcm_3" + +[ "$scw_b" ] && scw_B="-b $scw_b" +[ "$scw_m" ] && scw_M="-m $scw_m" +[ "$scw_o" ] && scw_O="-o $scw_o" + +cd $ADDON_DIR +chmod +x spotify-connect-web +./spotify-connect-web $scw_B \ + -k "$ADDON_HOME/spotify_appkey.key" \ + $scw_M \ + -n "$HOSTNAME" \ + $scw_O \ + -p "$scw_p" \ + -u "$scw_u" diff --git a/packages/addons/service/spotify-connect-web/source/default.py b/packages/addons/service/spotify-connect-web/source/default.py new file mode 100644 index 0000000000..3999a0eb31 --- /dev/null +++ b/packages/addons/service/spotify-connect-web/source/default.py @@ -0,0 +1,35 @@ +################################################################################ +# 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 . +################################################################################ + +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() diff --git a/packages/addons/service/spotify-connect-web/source/resources/language/English/strings.po b/packages/addons/service/spotify-connect-web/source/resources/language/English/strings.po new file mode 100644 index 0000000000..a245897ecb --- /dev/null +++ b/packages/addons/service/spotify-connect-web/source/resources/language/English/strings.po @@ -0,0 +1,68 @@ +# Kodi Media Center language file +# Addon Name: spotify-connect-web +msgid "" +msgstr "" + +msgctxt "#30000" +msgid "Configuration" +msgstr "" + +msgctxt "#30001" +msgid "Spotify" +msgstr "" + +msgctxt "#30002" +msgid "username" +msgstr "" + +msgctxt "#30003" +msgid "password" +msgstr "" + +msgctxt "#30004" +msgid "bit rate" +msgstr "" + +msgctxt "#30005" +msgid "" +msgstr "" + +msgctxt "#30006" +msgid "90" +msgstr "" + +msgctxt "#30007" +msgid "160" +msgstr "" + +msgctxt "#30008" +msgid "320" +msgstr "" + +msgctxt "#30009" +msgid "ALSA" +msgstr "" + +msgctxt "#30010" +msgid "playback device" +msgstr "" + +msgctxt "#30011" +msgid "playback route" +msgstr "" + +msgctxt "#30012" +msgid "auto detect" +msgstr "" + +msgctxt "#30013" +msgid "headphone jack" +msgstr "" + +msgctxt "#30014" +msgid "HDMI" +msgstr "" + +msgctxt "#30015" +msgid "mixer" +msgstr "" diff --git a/packages/addons/service/spotify-connect-web/source/resources/settings.xml b/packages/addons/service/spotify-connect-web/source/resources/settings.xml new file mode 100644 index 0000000000..b5fa3ae32c --- /dev/null +++ b/packages/addons/service/spotify-connect-web/source/resources/settings.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/packages/addons/service/spotify-connect-web/source/settings-default.xml b/packages/addons/service/spotify-connect-web/source/settings-default.xml new file mode 100644 index 0000000000..4549ca602a --- /dev/null +++ b/packages/addons/service/spotify-connect-web/source/settings-default.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/packages/addons/service/spotify-connect-web/source/system.d/service.spotify-connect-web.service b/packages/addons/service/spotify-connect-web/source/system.d/service.spotify-connect-web.service new file mode 100644 index 0000000000..91523d0a78 --- /dev/null +++ b/packages/addons/service/spotify-connect-web/source/system.d/service.spotify-connect-web.service @@ -0,0 +1,11 @@ +[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