Skip to content

Commit d66dff6

Browse files
committed
fix: correctly apply search bug fix
1 parent c381bae commit d66dff6

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/preprocess/preprocess.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,11 @@ func Start(version string, spotifyBasePath string, extractedAppsPath string, fla
215215
content = exposeAPIs_vendor(content, printPatch)
216216
}
217217

218+
if spotifyMajor >= 1 && spotifyMinor >= 2 && (spotifyPatch >= 28 && spotifyPatch <= 57) {
219+
utils.ReplaceOnce(&content, `(typeName\])`, func(submatches ...string) string {
220+
return fmt.Sprintf(`%s || []`, submatches[1])
221+
})
222+
}
218223
content = additionalPatches(content, printPatch)
219224
}
220225
printPatch("CSS (JS): Patching our mappings into file")
@@ -814,13 +819,6 @@ func additionalPatches(input string, report logPatch) string {
814819
return fmt.Sprintf(`=Spicetify.GraphQL.Definitions["%s"]%s`, submatches[2], submatches[1])
815820
},
816821
},
817-
{
818-
Name: "Search bug fix (>=1.2.28 and <=1.2.57)",
819-
Regex: `(typeName\\])`,
820-
Replacement: func(submatches ...string) string {
821-
return fmt.Sprintf(`%s || []`, submatches[1])
822-
},
823-
},
824822
}
825823

826824
return applyPatches(input, graphQLPatches, report)

0 commit comments

Comments
 (0)