Page 1 of 1
[Release] Spotify Plugin
Posted: March 17th, 2018, 2:44 pm
by grimsi
Howdy,
I created a plugin to read information from the Spotify client and display it on the LCD Screen.
I know that there is already a similiar plugin called "Spotify Status", but it seems to be broken atm and has less functionality than this.
I coded it in C# in 2 hours so its possible that I left a few bugs in it (please report them in this post or send me a PM).
All 3 .dll files have to be copied to the plugins folder.
- grimsi
REQUIREMENTS
------------
1. LCD Smartie 5.3 beta3 or newer
2. .NET Framework 4.5
3. Spotify Client running in the background
INFORMATION
-----------
This plugin allows you to display various information from your Spotify client on your LCD.
for more information refer to the Features part of this README.
Version
-------
0.1
Features
----------------
function1
Returns the name of the currently playing song
Usage:
$dll(spotify,1,,) -> Lose Yourself
function2
Returns the artists name of the currently playing song
Usage:
$dll(spotify,2,,) -> Eminem
function3
Returns the album name of the currently playing song
Usage:
$dll(spotify,3,,) -> Curtain Call (Deluxe)
function4
Returns current position in the song in the format mm:ss
Params:
param1 - set to "1" to disable leading zero
Usage:
$dll(spotify,4,1,) -> 1:54
$dll(spotify,4,,) -> 01:54
function5
Returns length of the current song in the format mm:ss
Params:
param1 - set to "1" to disable leading zero
Usage
$dll(spotify,5,1,) -> 5:26
$dll(spotify,5,,) -> 05:26
function6
Returns the volume level of the Spotify Client in percent
Usage:
$dll(spotify,6,,) -> 47
function20
Returns credits about the dll and its version.
KNOWN BUGS AND LIMITATIONS
--------------------------
1. When Spotify is not running in the background the dll will return an exception.
2. It is currently not possible to display the information of a podcast except length and current position (an exception will be returned).
3. If a song is longer than 60 minutes the plugin will only show the minutes and seconds of the total length and the current position (will be fixed soon).
Re: [Release] Spotify Plugin
Posted: March 17th, 2018, 6:01 pm
by trihy
grimsi wrote:Howdy,
KNOWN BUGS AND LIMITATIONS
--------------------------
1. When Spotify is not running in the background the dll will return an exception.
2. It is currently not possible to display the information of a podcast except length and current position (an exception will be returned).
3. If a song is longer than 60 minutes the plugin will only show the minutes and seconds of the total length and the current position (will be fixed soon).
Hi, yes old plugin got broken with latest spotify update.
This one works great. Thanks.
Maybe we can change the dll exception with a custom text? Maybe `waiting for spotify` or other text. Or a cfg to put custom message.
BTW, I opened a thread about a netflix plugin request, do you think it can be done?
Re: [Release] Spotify Plugin
Posted: March 17th, 2018, 6:28 pm
by trihy
Im having a problem using character replacement.
I have my list of foreign characters to be replaced by subst plugin (cause my display wont show foreign characters right by default)
But on this plugin, foreign characters are replaced by two weird symbols, different than one weird symbol it shows on other plugins. Could this plugin using a different charset? ascii table?
Any ideas if this can be changed?
Same problem occured with old spotify plugin.
Thanks
Re: [Release] Spotify Plugin
Posted: March 18th, 2018, 2:20 pm
by grimsi
trihy wrote:
Maybe we can change the dll exception with a custom text? Maybe `waiting for spotify` or other text. Or a cfg to put custom message.
It kinda already does that. In case of an error it returns an exception with a description of the error (e.g. "Spotify client not running"), but the text gets displayed at the very end of the exception on your LCD so you have to wait until it scrolls to that part. There is nothing I can really do about that because thats how C# (and most other object-oriented programming languages) works except calling the "connect to Spotify" part every time a function gets called.
I tried that and it works but it has a huge impact on performance, because when the plugin gets loaded it tries to connect to your Spotify client once (which takes comparatively long) and when a function gets called it just uses the already connected client. When it tries to connect on every function call (once per second) LCD Smartie will freeze for a short time every second.
trihy wrote:
BTW, I opened a thread about a netflix plugin request, do you think it can be done?
Afaik the Netflix Client does not offer an API unlike the Spotify Client which makes it almost impossible to read information such as "currently playing" or similiar.
trihy wrote:
Im having a problem using character replacement.
I have my list of foreign characters to be replaced by subst plugin (cause my display wont show foreign characters right by default)
But on this plugin, foreign characters are replaced by two weird symbols, different than one weird symbol it shows on other plugins. Could this plugin using a different charset? ascii table?
Any ideas if this can be changed?
I think it has something to do with C# returning UTF-16 encoded strings instead of ASCII encoded ones afaik. I will try to find a solution for that.
Re: [Release] Spotify Plugin
Posted: March 18th, 2018, 4:10 pm
by trihy
No way to add other function when spoty is not running? like read a text from cfg file? like a conditional.
Oh, I see. Guess netflix has a closed api.
grimsi wrote:
I think it has something to do with C# returning UTF-16 encoded strings instead of ASCII encoded ones afaik. I will try to find a solution for that.
Hi, yes, that could be the problem. Hope its an easy fix! It will be perfect then.
Re: [Release] Spotify Plugin
Posted: July 21st, 2018, 2:17 am
by trihy
grimsi wrote:trihy wrote:
Maybe we can change the dll exception with a custom text? Maybe `waiting for spotify` or other text. Or a cfg to put custom message.
It kinda already does that. In case of an error it returns an exception with a description of the error (e.g. "Spotify client not running"), but the text gets displayed at the very end of the exception on your LCD so you have to wait until it scrolls to that part. There is nothing I can really do about that because thats how C# (and most other object-oriented programming languages) works except calling the "connect to Spotify" part every time a function gets called.
I tried that and it works but it has a huge impact on performance, because when the plugin gets loaded it tries to connect to your Spotify client once (which takes comparatively long) and when a function gets called it just uses the already connected client. When it tries to connect on every function call (once per second) LCD Smartie will freeze for a short time every second.
trihy wrote:
BTW, I opened a thread about a netflix plugin request, do you think it can be done?
Afaik the Netflix Client does not offer an API unlike the Spotify Client which makes it almost impossible to read information such as "currently playing" or similiar.
trihy wrote:
Im having a problem using character replacement.
I have my list of foreign characters to be replaced by subst plugin (cause my display wont show foreign characters right by default)
But on this plugin, foreign characters are replaced by two weird symbols, different than one weird symbol it shows on other plugins. Could this plugin using a different charset? ascii table?
Any ideas if this can be changed?
I think it has something to do with C# returning UTF-16 encoded strings instead of ASCII encoded ones afaik. I will try to find a solution for that.
Seems latest spotify update breaks compatibility again.
Re: [Release] Spotify Plugin
Posted: July 26th, 2018, 5:56 pm
by grimsi
It turned out that spotify disabled their local API with the newest udpate.
See:
https://developer.spotify.com/community ... ay-button/
Remote control of Spotify’s desktop app has been deprecated in favour of full track playback in the browser.
For now this plugin is
deprecated and it
wont work any more.
If Spotify changes their mind in the future I will most likely update it again.
Re: [Release] Spotify Plugin
Posted: October 17th, 2018, 11:50 am
by guest3284329
Seems like some workaounds are being planned by dev
https://github.com/JohnnyCrazy/SpotifyA ... issues/254
Hope it will be able to make it work.
Re: [Release] Spotify Plugin
Posted: October 17th, 2018, 5:27 pm
by trihy
You have one working perfect here
viewtopic.php?f=8&t=3705
Not sure how dev made it without using web api, but works great.
Not sure if a web api based one will be more future proof.