Closed hugeBlack closed 1 month ago
Some timestamps of time-synced lyrics from LRCLIB cannot be matched with the regex in the LyricHelper.swift and cause crash.
LyricHelper.swift
For example, the first line in the lyric of song "Hope is the Thing With Feathers" by "Robin/HOYO-MiX/Chevy" is
[00:15] We rise together as our destiny unfolds
The regex is: https://github.com/whoeevee/EeveeSpotify/blob/3c282200403da60cf2934dabada0c0a8f4c5faa4/Sources/EeveeSpotify/Lyrics/Helpers/LyricsHelper.swift#L43
This regex fails to find match from this line since seconds has no decimal part and crashes the app with Fatal error: Unexpectedly found nil while unwrapping an Optional value
Fatal error: Unexpectedly found nil while unwrapping an Optional value
Changing this regex to
"\\[(?<minute>\\d{2}):(?<seconds>\\d{2}\\.?\\d*)\\] ?(?<content>.*)"
can solve this issue.
a PR would be appreciated
Some timestamps of time-synced lyrics from LRCLIB cannot be matched with the regex in the
LyricHelper.swift
and cause crash.For example, the first line in the lyric of song "Hope is the Thing With Feathers" by "Robin/HOYO-MiX/Chevy" is
The regex is: https://github.com/whoeevee/EeveeSpotify/blob/3c282200403da60cf2934dabada0c0a8f4c5faa4/Sources/EeveeSpotify/Lyrics/Helpers/LyricsHelper.swift#L43
This regex fails to find match from this line since seconds has no decimal part and crashes the app with
Fatal error: Unexpectedly found nil while unwrapping an Optional value
Changing this regex to
can solve this issue.