WIP
This commit is contained in:
@@ -25,6 +25,26 @@ struct ExerciseElement: Codable, Equatable {
|
||||
}
|
||||
}
|
||||
|
||||
extension ExerciseElement {
|
||||
func videoURL(nsfw: Bool) -> URL? {
|
||||
var _url: URL?
|
||||
|
||||
if nsfw {
|
||||
let viddd = exercise.nsfwVideoURL
|
||||
if let url = URL(string: BaseURLs.currentBaseURL + viddd) {
|
||||
_url = url
|
||||
}
|
||||
} else {
|
||||
let viddd = exercise.videoURL
|
||||
if let url = URL(string: BaseURLs.currentBaseURL + viddd) {
|
||||
_url = url
|
||||
}
|
||||
}
|
||||
|
||||
return _url
|
||||
}
|
||||
}
|
||||
|
||||
struct ExerciseExercise: Codable, Hashable, Identifiable {
|
||||
static func == (lhs: ExerciseExercise, rhs: ExerciseExercise) -> Bool {
|
||||
lhs.id == rhs.id
|
||||
@@ -62,3 +82,23 @@ struct ExerciseExercise: Codable, Hashable, Identifiable {
|
||||
case nsfwVideoURL = "nsfw_video_url"
|
||||
}
|
||||
}
|
||||
|
||||
extension ExerciseExercise {
|
||||
func videoURL(nsfw: Bool) -> URL? {
|
||||
var _url: URL?
|
||||
|
||||
if nsfw {
|
||||
let viddd = nsfwVideoURL
|
||||
if let url = URL(string: BaseURLs.currentBaseURL + viddd) {
|
||||
_url = url
|
||||
}
|
||||
} else {
|
||||
let viddd = videoURL
|
||||
if let url = URL(string: BaseURLs.currentBaseURL + viddd) {
|
||||
_url = url
|
||||
}
|
||||
}
|
||||
|
||||
return _url
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user