This commit is contained in:
Trey t
2023-07-13 22:53:29 -05:00
parent 93b8d674b4
commit d57afc1527
2 changed files with 53 additions and 5 deletions

View File

@@ -54,6 +54,21 @@ extension ExerciseElement {
}
return nil
}
func returnOtherVideoURL(currentURL: URL) -> URL? {
var urlString: String?
if currentURL.absoluteString.lowercased().contains(exercise.nsfwVideoURL.lowercased()) {
urlString = exercise.videoURL
} else {
urlString = exercise.nsfwVideoURL
}
if let urlString = urlString,
let url = URL(string: BaseURLs.currentBaseURL + urlString) {
return url
}
return nil
}
}
struct ExerciseExercise: Codable, Hashable, Identifiable {
@@ -123,4 +138,19 @@ extension ExerciseExercise {
}
return nil
}
func returnOtherVideoURL(currentURL: URL) -> URL? {
var urlString: String?
if currentURL.absoluteString.lowercased().contains(nsfwVideoURL.lowercased()) {
urlString = videoURL
} else {
urlString = nsfwVideoURL
}
if let urlString = urlString,
let url = URL(string: BaseURLs.currentBaseURL + urlString) {
return url
}
return nil
}
}