diff --git a/Sources/EeveeSpotify/DataLoaderServiceHooks.x.swift b/Sources/EeveeSpotify/DataLoaderServiceHooks.x.swift index c39314b..f848f79 100644 --- a/Sources/EeveeSpotify/DataLoaderServiceHooks.x.swift +++ b/Sources/EeveeSpotify/DataLoaderServiceHooks.x.swift @@ -85,7 +85,9 @@ class SPTDataLoaderServiceHook: ClassHook { orig.URLSession( session, dataTask: task, - didReceiveData: try getCurrentTrackLyricsData() + didReceiveData: try getCurrentTrackLyricsData( + originalLyrics: try? Lyrics(serializedData: data) + ) ) orig.URLSession(session, task: task, didCompleteWithError: nil) diff --git a/Sources/EeveeSpotify/Lyrics/CustomLyrics.x.swift b/Sources/EeveeSpotify/Lyrics/CustomLyrics.x.swift index e81c025..b3531b7 100644 --- a/Sources/EeveeSpotify/Lyrics/CustomLyrics.x.swift +++ b/Sources/EeveeSpotify/Lyrics/CustomLyrics.x.swift @@ -28,7 +28,7 @@ class EncoreButtonHook: ClassHook { } } -func getCurrentTrackLyricsData() throws -> Data { +func getCurrentTrackLyricsData(originalLyrics: Lyrics? = nil) throws -> Data { guard let track = HookedInstances.currentTrack else { throw LyricsError.NoCurrentTrack @@ -67,7 +67,7 @@ func getCurrentTrackLyricsData() throws -> Data { } let lyrics = try Lyrics.with { - $0.colors = LyricsColors.with { + $0.colors = originalLyrics?.colors ?? LyricsColors.with { $0.backgroundColor = Color(hex: track.extractedColorHex()).normalized.uInt32 $0.lineColor = Color.black.uInt32 $0.activeLineColor = Color.white.uInt32