Skip to content

Commit 0a9a7ff

Browse files
committed
fix: add support for Spotify 1.2.62
1 parent d1a5485 commit 0a9a7ff

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

jsHelper/spicetifyWrapper.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,6 @@ applyScrollingFix();
684684
Routes: functionModules.find((m) => m.toString().match(/\([\w$]+\)\{let\{children:[\w$]+,location:[\w$]+\}=[\w$]+/)),
685685
Route: functionModules.find((m) => m.toString().match(/^function [\w$]+\([\w$]+\)\{\(0,[\w$]+\.[\w$]+\)\(\!1\)\}$/)),
686686
StoreProvider: functionModules.find((m) => m.toString().includes("notifyNestedSubs") && m.toString().includes("serverState")),
687-
Navigation: exportedMemoFRefs.find((m) => m.type.render.toString().includes("navigationalRoot")),
688687
ScrollableContainer: functionModules.find((m) => m.toString().includes("scrollLeft") && m.toString().includes("showButtons")),
689688
IconComponent: reactComponentsUI.Icon,
690689
...Object.fromEntries(menus),
@@ -726,6 +725,8 @@ applyScrollingFix();
726725
});
727726

728727
if (!Spicetify.ContextMenuV2._context) Spicetify.ContextMenuV2._context = Spicetify.React.createContext({});
728+
if (!Spicetify.ReactComponent.Navigation)
729+
Spicetify.ReactComponent.Navigation = exportedMemoFRefs.find((m) => m.type.render.toString().includes("navigationalRoot"));
729730

730731
(function waitForChunks() {
731732
const listOfComponents = [

src/cmd/cmd.go

+3
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ func InitPaths() {
7070
os.Exit(1)
7171
}
7272
utils.PrintError(`Cannot detect Spotify location. Please manually set "spotify_path" in config-xpui.ini`)
73+
if runtime.GOOS == "windows" {
74+
utils.PrintInfo("Please make sure Spotify is not installed via Microsoft Store. If it is, please uninstall it and install Spotify with their web installer.")
75+
}
7376
os.Exit(1)
7477
}
7578

src/preprocess/preprocess.go

+9-1
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ func exposeAPIs_main(input string) string {
504504
// Spicetify._platform
505505
utils.Replace(
506506
&input,
507-
`(setTitlebarHeight[\w(){}<>:.,&$!=;""?!#% ]+)(\{version:[a-zA-Z_\$][\w\$]*,)`,
507+
`((?:setTitlebarHeight|registerFactory)[\w(){}<>:.,&$!=;""?!#% ]+)(\{version:[a-zA-Z_\$][\w\$]*,)`,
508508
func(submatches ...string) string {
509509
return fmt.Sprintf("%sSpicetify._platform=%s", submatches[1], submatches[2])
510510
})
@@ -572,6 +572,14 @@ func exposeAPIs_main(input string) string {
572572
return fmt.Sprintf("Spicetify.Snackbar.enqueueImageSnackbar=%s", submatches[0])
573573
})
574574

575+
utils.ReplaceOnce(
576+
&input,
577+
`(;const [\w\d]+=)((?:\(0,[\w\d]+\.memo\))[\(\d,\w\.\){:}=]+\=[\d\w]+\.[\d\w]+\.getLocaleForURLPath\(\))`,
578+
func(submatches ...string) string {
579+
fmt.Println(submatches)
580+
return fmt.Sprintf("%sSpicetify.ReactComponent.Navigation=%s", submatches[1], submatches[2])
581+
})
582+
575583
// Menu hook
576584
utils.Replace(&input, `("Menu".+?children:)([\w$][\w$\d]*)`, func(submatches ...string) string {
577585
return fmt.Sprintf("%s[Spicetify.ContextMenuV2.renderItems(),%s].flat()", submatches[1], submatches[2])

0 commit comments

Comments
 (0)