mirror of
https://github.com/whoeevee/EeveeSpotifyReborn.git
synced 2026-01-09 00:23:20 +01:00
real lrclib crash fix
This commit is contained in:
@@ -35,12 +35,14 @@ class LyricsHelper {
|
||||
.dropLast()
|
||||
|
||||
if plain.timeSynced {
|
||||
|
||||
lyricLines = lines.map { line in
|
||||
|
||||
let match = line.firstMatch(
|
||||
"\\[(?<minute>\\d{2}):(?<seconds>\\d{2}\\.?\\d*)\\] ?(?<content>.*)"
|
||||
)!
|
||||
lyricLines = lines.compactMap { line in
|
||||
|
||||
guard let match = line.firstMatch(
|
||||
"\\[(?<minute>\\d*):(?<seconds>\\d*\\.?\\d*)\\] ?(?<content>.*)"
|
||||
) else {
|
||||
return nil
|
||||
}
|
||||
|
||||
var captures: [String: String] = [:]
|
||||
|
||||
@@ -52,6 +54,10 @@ class LyricsHelper {
|
||||
captures[name] = String(line[substringRange])
|
||||
}
|
||||
}
|
||||
|
||||
if captures.count != 3 {
|
||||
return nil
|
||||
}
|
||||
|
||||
let minute = Int(captures["minute"]!)!
|
||||
let seconds = Float(captures["seconds"]!)!
|
||||
|
||||
Reference in New Issue
Block a user