This commit is contained in:
Trey t
2023-07-24 11:22:29 -05:00
parent 2753e31f24
commit 2dcd260887
12 changed files with 298 additions and 150 deletions

View File

@@ -8,7 +8,7 @@
import Foundation
struct SupersetExercise: Identifiable, Codable, Equatable, Hashable {
var id = UUID()
var id: Int
let workout: Int?
let exercise: Exercise
@@ -19,12 +19,15 @@ struct SupersetExercise: Identifiable, Codable, Equatable, Hashable {
let weightAudio: String?
let createdAt: String
let order, superset: Int
let uniqueID: String
let description: String?
enum CodingKeys: String, CodingKey {
case workout, exercise, weight, reps, duration, order, superset
case workout, exercise, weight, reps, duration, order, superset, id, description
case durationAudio = "duration_audio"
case weightAudio = "weight_audio"
case createdAt = "created_at"
case uniqueID = "unique_id"
}
public func hash(into hasher: inout Hasher) {
@@ -67,4 +70,13 @@ struct Exercise: Identifiable, Codable, Equatable {
case muscleGroups = "muscle_groups"
case synonyms
}
var extName: String {
if side.count > 0 {
var returnString = name + " - " + side
returnString = returnString.replacingOccurrences(of: "_", with: " ")
return returnString.capitalized
}
return name
}
}