mirror of
https://github.com/whoeevee/EeveeSpotifyReborn.git
synced 2026-01-09 00:23:20 +01:00
original lyrics colors when possible
This commit is contained in:
@@ -85,7 +85,9 @@ class SPTDataLoaderServiceHook: ClassHook<NSObject> {
|
||||
orig.URLSession(
|
||||
session,
|
||||
dataTask: task,
|
||||
didReceiveData: try getCurrentTrackLyricsData()
|
||||
didReceiveData: try getCurrentTrackLyricsData(
|
||||
originalLyrics: try? Lyrics(serializedData: data)
|
||||
)
|
||||
)
|
||||
|
||||
orig.URLSession(session, task: task, didCompleteWithError: nil)
|
||||
|
||||
@@ -28,7 +28,7 @@ class EncoreButtonHook: ClassHook<UIButton> {
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user