Help needed to test Spotify plugin with Oauth

Discuss, contribute and orient Volumio development!

Ads helps Volumio remain Free and Open Source. Please consider donating to help us continue to serve you.

Help needed to test Spotify plugin with Oauth

Postby fork » Wed Dec 19 2018 17:31

Hi,

I`m on latest version volumio: 2.513, and sadly it didn't work for me :( I`ve tried two times.
Random avatar
fork
Fresh off the boat
Fresh off the boat
 
Posts: 1
Joined: Wed Dec 19 2018 17:26

Ads helps Volumio remain Free and Open Source. Please consider donating to help us continue to serve you.


Help needed to test Spotify plugin with Oauth

Postby skikirkwood » Wed Dec 19 2018 18:40

RamsesVD wrote:Hi,
worked my path through the described procedure and it worked so far. Thumbs up!
I am only wondering if the section "My playlists" is limited to 50 playlists?
(actually I have much more playlists in my spotify account, but only the first 50 are shown)

Thanks for any help or info about that.
Greetings . Volker.

Hi There, unfortunately the Spotify Web API maxes out at 50 results. There is support for pagination, and I believe some other contributors here are looking at extending the plugin to support paginated results.
Volumio 2 on Raspberry Pi 3 B+, Schiit Modi 2 Multibit DAC, Volumio 2 on Raspberry Pi 3, IQAudio Pi-DAC+, Schiit Freya preamp, Bryston 3b power amp, B&W 803 speakers
User avatar
skikirkwood
Objectivist
Objectivist
 
Posts: 252
Joined: Thu Jan 08 2015 17:16
Location: Los Altos Hills, California


Help needed to test Spotify plugin with Oauth

Postby lorbass » Fri Dec 21 2018 20:30

I tested both procedures . They worked fine.

:) Thx alot and have a nice x-mas time
User avatar
lorbass
Fresh off the boat
Fresh off the boat
 
Posts: 2
Joined: Sat Dec 15 2018 17:48


Help needed to test Spotify plugin with Oauth

Postby marco79cgn » Fri Jan 04 2019 00:01

skikirkwood wrote:Hi There, unfortunately the Spotify Web API maxes out at 50 results. There is support for pagination, and I believe some other contributors here are looking at extending the plugin to support paginated results.


Unfortunately I was busy during december/christmas holidays.

The Spotify Web API has pagination support. Here is an example of a request containing playlist 3 and 4 of my total 268 playlists. I'm using small numbers for explanation, at the end we would of course use the maximum of 50 results (and then the next 50 and so on).

Code: Select all
{
   "href":"https://api.spotify.com/v1/users/almeidactu/playlists?offset=2&limit=2",
   "items":[
      ... // array containing playlist 3 and 4
   ],
   "limit":2,
   "next":"https://api.spotify.com/v1/users/almeidactu/playlists?offset=4&limit=2",
   "offset":2,
   "previous":"https://api.spotify.com/v1/users/almeidactu/playlists?offset=0&limit=2",
   "total":268
}


So as you can see, the api result includes the correct search urls for both previous (playlist 1 and 2) and next (playlist 5 & 6) results. So how can we add this to the Volumio UI? Is it possible to add a "next" arrow button to the navigation right beside the "back" arrow button? If so, then maybe we could map the previous/next search urls to these buttons and populate the list on the fly? Is it possible to perform a search request upon pressing these navigation buttons or are they static? :?:

Image
User avatar
marco79cgn
Serious Listener
Serious Listener
 
Posts: 84
Joined: Sun Aug 27 2017 22:12
Location: Cologne, Germany


Help needed to test Spotify plugin with Oauth

Postby MartinT » Fri Jan 11 2019 20:29

Thank you for this. It worked and I have my playlists back.
User avatar
MartinT
Sunday DIYer
Sunday DIYer
 
Posts: 48
Joined: Wed Jul 30 2014 12:53


Help needed to test Spotify plugin with Oauth

Postby billjon » Tue Jan 29 2019 03:01

[quote="fork"]Hi,

I`m on latest version volumio: 2.513, and sadly it didn't work for me :( I`ve tried two times

I used skikirkwood's procedures successfully, however, as soon as I updated to version 2.513 my playlists and other features were deleted.

Now the procedures do not work and I have tried a few times under version 2.513 and the previous version.
Random avatar
billjon
Fresh off the boat
Fresh off the boat
 
Posts: 1
Joined: Fri Jul 14 2017 17:42


Help needed to test Spotify plugin with Oauth

Postby CarloCouvert » Sat Mar 02 2019 15:09

Hi everybody,
Thanks a lot for the fantastic work you are doing!
I followed the instructions on page 17, now I can see may playsists, saved albums etc, I can put the on the queue BUT I cannot play any song from Spotify. Playing files from my disk i'ts ok when I try to play a song from spotify nothing happens.
Here the log file :
Code: Select all
2019-03-02T15:00:05.387Z - info: CoreCommandRouter::volumioPlay
2019-03-02T15:00:05.388Z - info: CoreStateMachine::play index 9
2019-03-02T15:00:05.389Z - info: CoreStateMachine::setConsumeUpdateService undefined
2019-03-02T15:00:05.389Z - info: CoreStateMachine::stop
2019-03-02T15:00:05.389Z - info: CoreStateMachine::setConsumeUpdateService undefined
2019-03-02T15:00:05.390Z - info: CoreStateMachine::updateTrackBlock
2019-03-02T15:00:05.390Z - info: CorePlayQueue::getTrackBlock
2019-03-02T15:00:05.390Z - info: CoreStateMachine::stPlaybackTimer
2019-03-02T15:00:05.391Z - info: CoreStateMachine::pushState
2019-03-02T15:00:05.391Z - info: CoreStateMachine::getState
2019-03-02T15:00:05.391Z - info: CorePlayQueue::getTrack 18
2019-03-02T15:00:05.391Z - info: CoreCommandRouter::volumioPushState
2019-03-02T15:00:05.392Z - info: CoreCommandRouter::executeOnPlugin: volumiodiscovery , saveDeviceInfo
2019-03-02T15:00:05.413Z - info: CoreStateMachine::serviceStop
2019-03-02T15:00:05.414Z - info: CorePlayQueue::getTrack 18
2019-03-02T15:00:05.414Z - info: CoreCommandRouter::serviceStop
2019-03-02T15:00:05.415Z - info: ControllerMpd::stop
2019-03-02T15:00:05.415Z - info: ControllerMpd::sendMpdCommand stop
2019-03-02T15:00:05.419Z - info: sending command...
2019-03-02T15:00:05.425Z - info:
---------------------------- MPD announces state update: player
2019-03-02T15:00:05.426Z - info: parsing response...
2019-03-02T15:00:05.426Z - info: ControllerMpd::getState
2019-03-02T15:00:05.427Z - info: ControllerMpd::sendMpdCommand status
2019-03-02T15:00:05.427Z - info: CoreStateMachine::play index undefined
2019-03-02T15:00:05.428Z - info: CoreStateMachine::setConsumeUpdateService undefined
2019-03-02T15:00:05.428Z - info: sending command...
2019-03-02T15:00:05.429Z - info: CorePlayQueue::getTrack 9
2019-03-02T15:00:05.430Z - info: CoreStateMachine::startPlaybackTimer
2019-03-02T15:00:05.430Z - info: CorePlayQueue::getTrack 9
2019-03-02T15:00:05.431Z - info: [1551538805430] ControllerSpop::clearAddPlayTrack
2019-03-02T15:00:05.431Z - info: {"service":"spop","type":"song","title":"Cloud of Light","name":"Cloud of Light","artist":"Masayoshi Fujita","album":"Book of Life","albumart":"https://i.scdn.co/image/a7ccd56f0723dcdf8b9f8ce96a2a5e8d905db696","uri":"spotify:track:4VHPXux9669W5GxFG0Usoy","samplerate":"320Kbps","bitdepth":"16 bit","trackType":"spotify","duration":309}
2019-03-02T15:00:05.432Z - info: [1551538805431] ControllerSpop::sendSpopCommand
2019-03-02T15:00:05.432Z - info: ADDING DEFER FOR COMMAND uplay
2019-03-02T15:00:05.437Z - info: SPOP command error:
2019-03-02T15:00:05.438Z - info:  message=This socket has been ended by the other party, stack=Error: This socket has been ended by the other party
    at Socket.writeAfterFIN [as write] (net.js:364:12)
    at applyWithContext (/data/plugins/music_service/spop/node_modules/fast.js/function/applyWithContext.js:15:22)
    at /data/plugins/music_service/spop/node_modules/fast.js/function/bind.js:63:14
    at onBoundPromise (/data/plugins/music_service/spop/node_modules/kew/kew.js:834:10)
    at ncall (/data/plugins/music_service/spop/node_modules/kew/kew.js:816:44)
    at Object.nfcall (/data/plugins/music_service/spop/node_modules/kew/kew.js:803:16)
    at Promise._successFn (/data/plugins/music_service/spop/index.js:1461:16)
    at nextTickCallback (/data/plugins/music_service/spop/node_modules/kew/kew.js:47:28)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9), code=EPIPE
2019-03-02T15:00:05.450Z - info: parsing response...
2019-03-02T15:00:05.450Z - info: ControllerMpd::parseState
2019-03-02T15:00:05.451Z - info: ControllerMpd::sendMpdCommand playlistinfo
2019-03-02T15:00:05.451Z - info: sending command...
2019-03-02T15:00:05.453Z - info: parsing response...
2019-03-02T15:00:05.453Z - info: ControllerMpd::parseTrackInfo
2019-03-02T15:00:05.454Z - info: ControllerMpd::pushState
2019-03-02T15:00:05.454Z - info: CoreCommandRouter::servicePushState
2019-03-02T15:00:05.454Z - info: CoreStateMachine::syncState
2019-03-02T15:00:05.455Z - info: CoreStateMachine::pushState
2019-03-02T15:00:05.455Z - info: CoreStateMachine::getState
2019-03-02T15:00:05.455Z - info: CorePlayQueue::getTrack 9
2019-03-02T15:00:05.455Z - info: CoreCommandRouter::volumioPushState
2019-03-02T15:00:05.456Z - info: CoreCommandRouter::executeOnPlugin: volumiodiscovery , saveDeviceInfo
2019-03-02T15:00:05.477Z - info: CorePlayQueue::getTrack 9
2019-03-02T15:00:05.478Z - info: Received update from a service different from the one supposed to be playing music. Skipping notification.Current spop Received mpd
2019-03-02T15:00:05.481Z - info: ------------------------------ 56ms


Volumio version 2.555

Thank you for your help
Random avatar
CarloCouvert
Fresh off the boat
Fresh off the boat
 
Posts: 3
Joined: Sun Feb 12 2017 16:14


Help needed to test Spotify plugin with Oauth

Postby thertor » Sat Mar 09 2019 21:56

Hi,
This works great for listing the playlists, however, when I press any of the playlists, I can't access them nor play any songs from them :/
Random avatar
thertor
Fresh off the boat
Fresh off the boat
 
Posts: 1
Joined: Sat Mar 09 2019 21:55


Help needed to test Spotify plugin with Oauth

Postby skikirkwood » Sun Mar 10 2019 02:51

thertor wrote:Hi,
This works great for listing the playlists, however, when I press any of the playlists, I can't access them nor play any songs from them :/

A patch will be available in the next few days. Spotify made a non-backward compatible change in their API recently.
Volumio 2 on Raspberry Pi 3 B+, Schiit Modi 2 Multibit DAC, Volumio 2 on Raspberry Pi 3, IQAudio Pi-DAC+, Schiit Freya preamp, Bryston 3b power amp, B&W 803 speakers
User avatar
skikirkwood
Objectivist
Objectivist
 
Posts: 252
Joined: Thu Jan 08 2015 17:16
Location: Los Altos Hills, California


Help needed to test Spotify plugin with Oauth

Postby skikirkwood » Sun Mar 10 2019 18:32

skikirkwood wrote:A patch will be available in the next few days. Spotify made a non-backward compatible change in their API recently.


Working on it now....
Volumio 2 on Raspberry Pi 3 B+, Schiit Modi 2 Multibit DAC, Volumio 2 on Raspberry Pi 3, IQAudio Pi-DAC+, Schiit Freya preamp, Bryston 3b power amp, B&W 803 speakers
User avatar
skikirkwood
Objectivist
Objectivist
 
Posts: 252
Joined: Thu Jan 08 2015 17:16
Location: Los Altos Hills, California

PreviousNext

Return to Development talks

Who is online

Users browsing this forum: No registered users and 0 guests