spicetify / cli

Command-line tool to customize Spotify client. Supports Windows, MacOS, and Linux.
https://spicetify.app
GNU Lesser General Public License v2.1
18.2k stars 715 forks source link

Use local CSS map when remote CSS map is malformed #2631

Closed FrzMtrsprt closed 10 months ago

FrzMtrsprt commented 10 months ago

đź“ť Provide a description of the new feature

Due to my own network issues, spicetify always receive broken data when fetching css map from raw.​githubusercontent.​com. As a result, Spotify is somehow patched using a wrong css map, rendering it unable to launch. To address this issue, spicetify should fallback to local css map not only when it can't fetch remote css map, but also when the remote css map is malformed.

âž• Additional Information

No response

SunsetTechuila commented 10 months ago

Send your malformed css map

rxri commented 10 months ago

CSS map should have no effect on properly launching Spotify. CSS map is fetched remotely only on latest version. If spicetify can't parse css map it will throw an error. If you did not see it then it's not malformed

SunsetTechuila commented 10 months ago

CSS map should have no effect on properly launching Spotify

It has effect if you use custom apps because the _cloneSidebarItem function, which has no try catch, relies on the mapped selectors

FrzMtrsprt commented 10 months ago

CSS map should have no effect on properly launching Spotify. CSS map is fetched remotely only on latest version. If spicetify can't parse css map it will throw an error. If you did not see it then it's not malformed

It does throw the error "css map malformed", but it continues patching, resulting spotify not launching

rxri commented 10 months ago

Regardless, if it would be malformed it should throw an error https://github.com/spicetify/spicetify-cli/blob/f0d3e9fa5382c3ec31774b78dd8d4261dc5e14d2/src/preprocess/preprocess.go#L47, and actually just noticed if remote css fails then it will load local css so your idea is already implemented

FrzMtrsprt commented 10 months ago

Well, it seems it doesn't. If it does it should log "using local css map" and Spotify shouldn't be showing up an error saying it can't render the page. image image

rxri commented 10 months ago

Made a pull request fixing this (#2632). This fix should be available in the next release

FrzMtrsprt commented 10 months ago

I see, thanks!