Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix:
New Releases
custom app for Spotify 1.1.81+ (#1563)
* Fix `New Releases` custom app for Spotify 1.1.81+ - Based on proposed fix for `Shuffle+` (#1559) - Fixes #1539 #1530 Notes: - Can probably be written nicer - this is my scuffed attempt to fix it - May or may not actually show all new releases for all followed artists - have over 665 of them but I don't think I'm getting all of them (see below) - May or may not return `error 500` (added `.catch()` block keeps it from breaking whole custom app) * Minimize `internal server error: 500`... ...for big libraries of followed artists. Changes: - Change `URL` to query only discographies - Limit amount of queried albums to 5 Notes: - This does **NOT** fixes erroring fully - it only maxes out amount of data you can query before getting rate limited - The more options you select (ex. albums + EPs + podcasts), the less data you may receive - To max number of albums received, I recommend to select only `Albums` (since `Singles and EPs` will probably get displayed anyway...) * Add notifications when error occurred Notifications added: - Error code (`500`, `429` etc.) - Amount of followed artists to fetch releases from - Amount of followed artists failed to fetch releases from I guess we have to get along with getting `500-ed` - one time it fetches everything instantly, second time it drops 60 artists... * "Prettify" file to pass `Prettier` test * Fix filtering, counter... - Fixing filtering as no matter was what set in config, it always displayed everything as "Album" - Fixing "Missing releases from..." counter - should properly reset now What broke again: - "Appears on" releases cannot be retrieved with that API endpoint - this filter is just there and doesn't do anything - this prevents from showing everything as "Appears on" etc. Notes: - There seem to be an API endpoint for retrieving "Related content" stuff - problem is that would query everything TWICE... which breaks everything even more (and we don't wanna do that) - If someone knows how to query everything using separate endpoint without doing it 4 times, let me know... * Forgor `( )`... Oops... 💀 I forgor 💀 * Include requested changes Changes: - Properly encode URI including variables - Make `limit` variable customizable via settings (set default to 5) - Make error messages as "dev console only" Notes: - Errors displayed in console may be a little spammy - if we get error early, there may be lots of lines displaying it + counter... * I'm not too sure how to tackle this - just remove them altogether? Or is there a function that could "suppress" them? * Switching from normal `log` to `debug` may help a little as they will be only visible if user has set their console log level to include `Verbose` - Making `limit` customizable may lead to even more errors but fuck it I guess - it's better to have a choice than not, right? * It can be manually input via custom app settings (same place where other options are) - there is no list etc. - it's just normal input field - Set `offset` value as const `0` and not making it customizable (cause why would you want to start searching from ex. 3rd album instead of beginning, right?) - Leaving `Fetching releases from...` notification cause it looks cool - it's fun to know how many followed artists you have 😆
- Loading branch information
Since, we got to know that wg:// has been replaced instead hm:// (thanks to @ririxidev), can't we technically revert back this commit, but keep changes like showing releases being fetched from 'x' artists, since this method is prone to being rate limited. Did test the change to wg:// and can confirm that it's working. @th3an7 @afonsojramos
Same could be said for shuffle+ as well, but i didn't look into shuffle+ working after reverting back to the previous state with the protocol being changed to wg://.