mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 21:43:41 +00:00
Fix parsing timestamps with Piped
This commit is contained in:
parent
83f033f4dd
commit
642354fc8e
@ -515,6 +515,8 @@ final class PipedAPI: Service, ObservableObject, VideosAPI {
|
||||
return matchingGroup
|
||||
}
|
||||
|
||||
description = description.replacingOccurrences(of: "&", with: "&")
|
||||
|
||||
description = description.replacingOccurrences(
|
||||
of: "<[^>]+>",
|
||||
with: "",
|
||||
|
@ -122,12 +122,19 @@ struct VideoDescription: View {
|
||||
|
||||
if var components = URLComponents(url: url, resolvingAgainstBaseURL: false) {
|
||||
components.scheme = "yattee"
|
||||
if let yatteeURL = components.url,
|
||||
URLParser(url: urlToOpen).destination != nil
|
||||
if let yatteeURL = components.url {
|
||||
let parser = URLParser(url: urlToOpen)
|
||||
if parser.destination == .video,
|
||||
parser.videoID == player.currentVideo?.videoID,
|
||||
let time = parser.time
|
||||
{
|
||||
player.backend.seek(to: Double(time))
|
||||
return
|
||||
} else {
|
||||
urlToOpen = yatteeURL
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
openURL(urlToOpen)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user