Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

[PSA] TOASTIFY IS PARTIALLY OUT OF SERVICE #86

Open
aleab opened this issue Aug 8, 2018 · 31 comments
Open

[PSA] TOASTIFY IS PARTIALLY OUT OF SERVICE #86

aleab opened this issue Aug 8, 2018 · 31 comments
Labels
(ノಥ益ಥ)ノ ┻━┻ ASDL FIKHASDUFKL VA Priority: Critical Status: Not Anytime Soon It probably won't happen in the near future

Comments

@aleab
Copy link
Owner

aleab commented Aug 8, 2018

CURRENT STATE OF TOASTIFY

As of v1.10.11 Toastify can fetch and show the current song's artist and title using a temporary workaround. The album art won't update and the song progress bar has been disabled altogether for the time being.
Hotkeys are still working fine and you'll still be able to control Spotify's playback with them.


THE ISSUE

The unofficial local API served by the Spotify client on a local server needs an OAuth token to be used. The token is retrieved from https://open.spotify.com/token.
Currently, Spotify only returns unusable fake tokens, so the local API can't be used anymore to get status updates.

Additionally, since Spotify's version 1.0.87.*, the client doesn't create the local server anymore.
This latest change makes Toastify fail to start (whereas before version 1.0.87 it started but the toast wouldn't work), because it obviously can't connect to the non-existing local server (before version 1.0.87, it managed to connect successfully, but failed the authentication whenever it tried to get a status update).

POSSIBLE SOLUTION

The only viable possible solution is to use the official Web API instead, in particular the player or player/currently-playing endpoints to get status updates.

The problem with this solution is that Toastify would need to make a lot of web requests to the same endpoint in a very limited time period to be able to update the toast in an enjoyably short (from a UX point of view) amount of time.
As a comparison SpotifyAPI-NET makes 20 status update requests per second by default (Toastify reduced that to 2 requests per second).


(Additional details can be found in issue #82)

@DiAbLoxx83
Copy link

I was just investigating why it won't connect "connected = this.localAPI.Connect();".
Thanks for that update, have a nice day!

I love Toastify :)

@ItzQuiet
Copy link

ItzQuiet commented Aug 9, 2018

Same problem.
Download the previous Spotify Versions:
https://spotify.en.uptodown.com/windows/old

@WolfganP
Copy link

WolfganP commented Aug 9, 2018

Download the previous Spotify Versions:

Do anyone knows what's the latest Spotify working version for Toastify?

@DiAbLoxx83
Copy link

The version 1.0.85.259 works fine.

@aleab
Copy link
Owner Author

aleab commented Aug 9, 2018

@ItzQuiet I'm sorry, but that would change very little.
You'll still be able to control Spotify's playback (which is wonderful!), but the toast (the core of Toastify) won't work.

@juliusdeblaaij
Copy link

@aleab to make it clear for me and the others, is there a specific Spotify version and Toastify version which still work together? I don`t mind downgrading my Spotify for now.

@aleab
Copy link
Owner Author

aleab commented Aug 9, 2018

@juliusdeblaaij None if you want toast notifications. If you only want to control Spotify's playback (i.e. you only need the global hotkeys), then every version of Spotify up to 1.0.86.* should work (the current version 1.0.87.* might also work, but I need to make some changes to the code before that happens).

@ifailsnoopy
Copy link

After you download an old version of Spotify how do you prevent Spotify from updating itself to the new version? I just really want to use Toastify for the hotkeys for now :(

@aleab
Copy link
Owner Author

aleab commented Aug 10, 2018

Hi folks!
I've made some changes to let Toastify start correctly with the latest version of Spotify (1.0.87.*). This doesn't fix the big issue, but you'll be able to use Toastify's hotkeys without unnecessarily downgrading Spotify.

Download the new release v1.10.9 here!

@IdleMuse
Copy link

Cheers for keeping this alive just for the global hotkeys, that's the large part of what I use it for anyway.

@JediBecker
Copy link

Ditto to what IdelMuse just said. The hotkeys are 95% of its value to me, so I appreciate you taking the time to release a version for just that.

@ifailsnoopy
Copy link

Thank you thank you so much for keeping this alive!

@pko-github
Copy link

Thanks for the fix! I mostly use the toast with the "show toast" hotkey to check what (Spotify-suggested) song I'm listening to. Perhaps that could be supported well using the web API without too many calls? (Since the calls would only be done after pressing the hotkey)

@bartuszekj
Copy link

As a temporary workaround, maybe something as simple as displaying the Spotify window title in the toast would suffice? When a song is playing, Spotify's title window is set to "Artist - Track". I know it's rudimentary, but it's better than nothing. Thoughts?

@pko-github
Copy link

That would work for me.

@lazyb5
Copy link

lazyb5 commented Aug 23, 2018

I would like to see that solution implemented if possible it's better then nothing. Why song toasts isn't a native feature is beyond me.

@aleab
Copy link
Owner Author

aleab commented Aug 25, 2018

Alright, I'll implement the solution proposed by @bartuszekj and possibly release a new version by the end of next week.

@bartuszekj
Copy link

Thanks for taking my suggestion under consideration, @aleab! Eagerly awaiting the next release now!

@TehCupcakes
Copy link

TehCupcakes commented Aug 29, 2018

While I like the idea of a local workaround, it's not quite as robust or future-proof as consuming the API. I'm thinking about adding Web API functionality, at least for my own use. Even if it is a tad delayed (say 5 seconds), that is totally acceptable to me personally. I'm wondering just how bad it is. Does anyone know what rate limits the api applies and how many requests are we talking for a single toast?

@aleab
Copy link
Owner Author

aleab commented Aug 29, 2018

@TehCupcakes, the local workaround would only be temporary.
I'm not sure about the rate limits applied by Spotify and there's no definitive number mentioned in the documentation (rate limiting).

As for the number of requests, I'm not sure about that either. We could easily get away with making a single request to /player or /player/currently-playing every time the Toast is shown (and not more than X times every Y seconds, for example) to update the current song info, album art, playing state, etc.; other features and options would instead require more requests.

At the moment I can think of two features that would require, in my opinion, at least a couple of requests per second to have a nice experience:

  • Showing the toast every time the song changes
  • Showing the song progress bar on the toast

Given that the rate limiting is applied per application and not per-user, I'm not sure how feasible that would be.

One more concern I have in using the Web APIs is the risk (more like certainty) of leaking the application keys (client id and secret), since I don't think I'll be able to use a backend for the authentication/authorization flow.

@philhawthorne
Copy link

The problem with the API is that the app will need to make a heap of web requests to detect when a song has changed.

Instead, perhaps it would be easier and more effective to only call the API when the title of the Spotify app changes, or a hot key is used.

@aleab
Copy link
Owner Author

aleab commented Aug 29, 2018

it would be easier and more effective to only call the API when the title of the Spotify app changes

I like this!

aleab added a commit that referenced this issue Aug 30, 2018
Temporary workaround proposed by @bartuszekj for issue #86
@aleab
Copy link
Owner Author

aleab commented Aug 31, 2018

Version 1.10.11 of Toastify is out!

@WolfganP
Copy link

Thanks @aleab ! Does it work with the latest Spotify version or some specific old one is required?

@aleab
Copy link
Owner Author

aleab commented Aug 31, 2018

@WolfganP It works fine with the latest version.

@lazyb5
Copy link

lazyb5 commented Aug 31, 2018

Working great with windows store version. Thanks for implementing the workaround!

@aleab aleab changed the title [PSA] TOASTIFY IS CURRENTLY OUT OF SERVICE [PSA] TOASTIFY IS PARTIALLY OUT OF SERVICE Sep 1, 2018
@quinnr
Copy link

quinnr commented Dec 2, 2018

Hello! Just discovered Toastify and love it, even in its (apparently stunted) state. Any progress on this? Shame that the Spotify's API support was thrown in the trash like it was.

Was looking for some ideas to try and help out with pull requests but it does seem like the issues are mainly on Spotify's end :(

Only thing I can think of is that at least on my computer it only shows the Toastify logo instead of any album art? Is that related to the API issue? If it isn't, would it maybe be possible to find a third party source to pull that art from?

@aleab
Copy link
Owner Author

aleab commented Dec 3, 2018

@quinnr I've already worked on implementing Spotify's Web API to be able to get album arts and more accurate info about a song's title/artist(s).
I still have to fix a bunch of other stuff and be sure that everything works as expected, though. It may take a while since I don't have much time to work on Toastify right now.

If you are interested in helping out, the current master branch in this repository is up to date and doesn't have any pending commits. You can start from that, if you want. The Web APIs are already being used and album arts should be fetched correctly.

@IdleMuse
Copy link

If the Album art is 'sort of working', would it be possible to build a beta release or something? Cheers!

@aleab
Copy link
Owner Author

aleab commented Feb 14, 2019

@IdleMuse of course it's possible. Unfortunately, I don't have any time at all to work on Toastify anymore, but I can release all I've worked on as is.

@WolfganP
Copy link

WolfganP commented Mar 26, 2019

@aleab I read your comments about not having much time to dedicate to Toastify, so let me start with thanking you for the work so far.
I noticed that there were some commits v1.11.1...master after the latest release https://github.com/aleab/toastify/releases/tag/v1.11.1 , would it be possible for you to post whatever you got after those sporadic changes?
I mean, whatever is easier for you, even if it's not an installer but an actual beta executable to replace the existing official release. Thanks in advance!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
(ノಥ益ಥ)ノ ┻━┻ ASDL FIKHASDUFKL VA Priority: Critical Status: Not Anytime Soon It probably won't happen in the near future
Projects
None yet
Development

No branches or pull requests