diff --git a/spotify/apiclient.js b/spotify/apiclient.js deleted file mode 100644 index a942557f3..000000000 --- a/spotify/apiclient.js +++ /dev/null @@ -1,26 +0,0 @@ -var superagent = require('superagent'); - -var apiEndpoint = 'http://127.0.0.1:9879'; - - -superagent.post(apiEndpoint + '/player/volume') - .accept('application/json') - .send({ 'volume': 50, 'volume_steps': 100 }) - .then((results) => { - console.log(results.body); - }).catch((err) => { - console.log(err); - }) - - -superagent.get(apiEndpoint + '/status') - .accept('application/json') - .then((results) => { - console.log(results.body); - }) - -superagent.get(apiEndpoint + '/player/volume') - .accept('application/json') - .then((results) => { - console.log(results.body); - }) \ No newline at end of file diff --git a/spotify/config.json b/spotify/config.json deleted file mode 100755 index 09775286c..000000000 --- a/spotify/config.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "enabled": { - "type": "boolean", - "value": false - }, - "initvol": { - "type": "string", - "value": "33" - }, - "normalvolume": { - "type": "boolean", - "value": false - }, - "bitrate": { - "type": "number", - "value": 320 - }, - "shareddevice": { - "type": "boolean", - "value": true - }, - "gapless": { - "type": "boolean", - "value": true - }, - "autoplay": { - "type": "boolean", - "value": true - }, - "username": { - "type": "string", - "value": "" - }, - "password": { - "type": "string", - "value": "" - }, - "volume_ctrl": { - "type": "string", - "value": "fixed" - }, - "debug": { - "type": "boolean", - "value": false - } -} diff --git a/spotify/index.js b/spotify/index.js index 5f7ed5862..d11ec04f6 100644 --- a/spotify/index.js +++ b/spotify/index.js @@ -2,7 +2,6 @@ var libQ = require('kew'); var fs = require('fs-extra'); -var config = new (require('v-conf'))(); var superagent = require('superagent'); var os = require('os'); var websocket = require('ws'); @@ -10,21 +9,13 @@ var path = require('path'); var SpotifyWebApi = require('spotify-web-api-node'); var io = require('socket.io-client'); var exec = require('child_process').exec; -var execSync = require('child_process').execSync; var NodeCache = require('node-cache'); -var os = require('os'); var { fetchPagedData, rateLimitedCall } = require('./utils/extendedSpotifyApi'); var configFileDestinationPath = '/tmp/go-librespot-config.yml'; var credentialsPath = '/data/configuration/music_service/spop/spotifycredentials.json'; var spotifyDaemonPort = '9879'; var spotifyLocalApiEndpointBase = 'http://127.0.0.1:' + spotifyDaemonPort; -var stateSocket = undefined; - -var selectedBitrate; -var loggedInUsername; -var loggedInUserId; -var userCountry; var seekTimer; var restartTimeout; var wsConnectionStatus = 'started'; @@ -791,15 +782,10 @@ ControllerSpotify.prototype.isOauthLoginAlreadyConfiguredOnDaemon = function () } }; -ControllerSpotify.prototype.saveGoLibrespotSettings = function (data, avoidBroadcastUiConfig) { +ControllerSpotify.prototype.saveGoLibrespotSettings = function (data) { var self = this; var defer = libQ.defer(); - var broadcastUiConfig = true; - if (avoidBroadcastUiConfig === true){ - broadcastUiConfig = false; - } - if (data.bitrate !== undefined && data.bitrate.value !== undefined) { self.config.set('bitrate_number', data.bitrate.value); } diff --git a/spotify/package.json b/spotify/package.json index 6b2ca695a..2c3d9b75d 100755 --- a/spotify/package.json +++ b/spotify/package.json @@ -8,9 +8,6 @@ }, "author": "Ashthespy, Balbuze, Skirkwood", "license": "ISC", - "vollibrespot": { - "version": "0.2.5" - }, "volumio_info": { "prettyName": "Spotify", "icon": "fa-spotify", diff --git a/spotify/remove.sh b/spotify/remove.sh deleted file mode 100755 index 53a17f611..000000000 --- a/spotify/remove.sh +++ /dev/null @@ -1,20 +0,0 @@ -# !/bin/bash -# this script removes last file in volspotconnect2 cache when cachesize limit is reached -ucachesize=64 #cache size Mo -cfolder=/tmp/files #folder where cache files are stored - - -cd $cfolder -checkedsize=$(du -sm $cfolder) -size=$(echo $checkedsize | cut -d' ' -f1) - -while [ $size -gt $ucachesize ] # condition to execute the cache purge - do - echo 'cache needs to be purged' - ls -tr1 | head -n 1 | xargs rm -Rf - echo purged - checkedsize=$(du -sm $cfolder) - size=$(echo $checkedsize | cut -d' ' -f1) - echo 'cache uses' $size 'Mo' - done -echo 'cache not full, nothing do' diff --git a/spotify/startconnect.sh b/spotify/startconnect.sh deleted file mode 100755 index 5073ea172..000000000 --- a/spotify/startconnect.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash -./usr/bin/vollibrespot \ - -c /tmp/volspotify.toml - # --verbose diff --git a/spotify/wsclient.js b/spotify/wsclient.js deleted file mode 100644 index 25ecd7e51..000000000 --- a/spotify/wsclient.js +++ /dev/null @@ -1,16 +0,0 @@ -//import WebSocket from 'ws'; -var websocket = require('ws'); - -var ws = new websocket('ws://localhost:9876/events'); - -ws.on('error', function(error){ - console.error(error); -}); - -ws.on('open', function open() { - ws.send('something'); -}); - -ws.on('message', function message(data) { - console.log('received: %s', data); -}); \ No newline at end of file