mirror of
https://github.com/whoeevee/EeveeSpotifyReborn.git
synced 2026-01-09 00:23:20 +01:00
kinda fix for #246
This commit is contained in:
@@ -26,7 +26,8 @@ class LyricsFullscreenViewControllerHook: ClassHook<UIViewController> {
|
||||
|
||||
if UserDefaults.lyricsSource == .musixmatch
|
||||
&& lastLyricsError == nil
|
||||
&& !lastLyricsWasRomanized {
|
||||
&& !lastLyricsWasRomanized
|
||||
&& !lastLyricsAreEmpty {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -41,6 +42,7 @@ class LyricsFullscreenViewControllerHook: ClassHook<UIViewController> {
|
||||
//
|
||||
|
||||
private var lastLyricsWasRomanized = false
|
||||
private var lastLyricsAreEmpty = false
|
||||
private var lastLyricsError: LyricsError? = nil
|
||||
|
||||
private var hasShownRestrictedPopUp = false
|
||||
@@ -212,6 +214,7 @@ func getCurrentTrackLyricsData(originalLyrics: Lyrics? = nil) throws -> Data {
|
||||
}
|
||||
|
||||
lastLyricsWasRomanized = lyricsDto.romanized
|
||||
lastLyricsAreEmpty = lyricsDto.lines.isEmpty
|
||||
|
||||
let lyrics = Lyrics.with {
|
||||
$0.colors = getLyricsColors()
|
||||
|
||||
@@ -11,13 +11,26 @@ struct LyricsDto {
|
||||
$0.timeSynchronized = timeSynced
|
||||
$0.restriction = .unrestricted
|
||||
$0.providedBy = "\(source) (EeveeSpotify)"
|
||||
$0.lines = lines.map { line in
|
||||
}
|
||||
|
||||
lyricsData.lines = lines.isEmpty
|
||||
? [
|
||||
LyricsLine.with {
|
||||
$0.content = "This song is instrumental."
|
||||
},
|
||||
LyricsLine.with {
|
||||
$0.content = "Let the music play..."
|
||||
},
|
||||
LyricsLine.with {
|
||||
$0.content = ""
|
||||
}
|
||||
]
|
||||
: lines.map { line in
|
||||
LyricsLine.with {
|
||||
$0.content = line.content
|
||||
$0.offsetMs = Int32(line.offsetMs ?? 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if let translation = translation {
|
||||
lyricsData.translation = LyricsTranslation.with {
|
||||
|
||||
@@ -2,6 +2,7 @@ import Foundation
|
||||
|
||||
@objc protocol SPTPlayerTrack {
|
||||
func setMetadata(_ metadata: [String:String])
|
||||
func metadata() -> [String:String]
|
||||
func extractedColorHex() -> String
|
||||
func trackTitle() -> String
|
||||
func artistTitle() -> String
|
||||
|
||||
Reference in New Issue
Block a user