WIP
This commit is contained in:
@@ -26,22 +26,33 @@ struct ExerciseElement: Codable, Equatable {
|
||||
}
|
||||
|
||||
extension ExerciseElement {
|
||||
func videoURL(nsfw: Bool) -> URL? {
|
||||
var _url: URL?
|
||||
func videoURL(thotStyle: ThotStyle) -> URL? {
|
||||
var urlString: String?
|
||||
|
||||
if nsfw {
|
||||
let viddd = exercise.nsfwVideoURL
|
||||
if let url = URL(string: BaseURLs.currentBaseURL + viddd) {
|
||||
_url = url
|
||||
switch thotStyle {
|
||||
case .always:
|
||||
urlString = exercise.nsfwVideoURL
|
||||
case .never:
|
||||
urlString = exercise.videoURL
|
||||
case .recovery:
|
||||
if self.exercise.name.lowercased() == "recover" {
|
||||
urlString = exercise.nsfwVideoURL
|
||||
} else {
|
||||
urlString = exercise.videoURL
|
||||
}
|
||||
} else {
|
||||
let viddd = exercise.videoURL
|
||||
if let url = URL(string: BaseURLs.currentBaseURL + viddd) {
|
||||
_url = url
|
||||
case .random:
|
||||
if Bool.random() {
|
||||
urlString = exercise.nsfwVideoURL
|
||||
} else {
|
||||
urlString = exercise.videoURL
|
||||
}
|
||||
}
|
||||
|
||||
return _url
|
||||
if let urlString = urlString,
|
||||
let url = URL(string: BaseURLs.currentBaseURL + urlString) {
|
||||
return url
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,21 +95,32 @@ struct ExerciseExercise: Codable, Hashable, Identifiable {
|
||||
}
|
||||
|
||||
extension ExerciseExercise {
|
||||
func videoURL(nsfw: Bool) -> URL? {
|
||||
var _url: URL?
|
||||
func videoURL(thotStyle: ThotStyle) -> URL? {
|
||||
var urlString: String?
|
||||
|
||||
if nsfw {
|
||||
let viddd = nsfwVideoURL
|
||||
if let url = URL(string: BaseURLs.currentBaseURL + viddd) {
|
||||
_url = url
|
||||
switch thotStyle {
|
||||
case .always:
|
||||
urlString = nsfwVideoURL
|
||||
case .never:
|
||||
urlString = videoURL
|
||||
case .recovery:
|
||||
if self.name.lowercased() == "recovery" {
|
||||
urlString = nsfwVideoURL
|
||||
} else {
|
||||
urlString = videoURL
|
||||
}
|
||||
} else {
|
||||
let viddd = videoURL
|
||||
if let url = URL(string: BaseURLs.currentBaseURL + viddd) {
|
||||
_url = url
|
||||
case .random:
|
||||
if Bool.random() {
|
||||
urlString = nsfwVideoURL
|
||||
} else {
|
||||
urlString = videoURL
|
||||
}
|
||||
}
|
||||
|
||||
return _url
|
||||
if let urlString = urlString,
|
||||
let url = URL(string: BaseURLs.currentBaseURL + urlString) {
|
||||
return url
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user