I think we're done

This commit is contained in:
cdricms
2026-03-21 18:25:21 +01:00
parent 2d1e8e1044
commit ba9e2db1b9
26 changed files with 281 additions and 63 deletions

View File

@@ -1,15 +1,15 @@
import Foundation
public enum Gender: String, Sendable {
public enum Gender: String, Sendable, Hashable, Equatable {
case male, female, other
case notApplicable = "not applicable"
}
public enum ArtistType: String, Sendable {
public enum ArtistType: String, Sendable, Hashable, Equatable {
case person, group, orchestra, choir, character, other
}
public enum Country: String, Sendable {
public enum Country: String, Sendable, Hashable, Equatable {
case af = "AF" // Afghanistan
case al = "AL" // Albania
case dz = "DZ" // Algeria
@@ -49,3 +49,31 @@ public enum Country: String, Sendable {
case gb = "GB" // United Kingdom
case us = "US" // United States
}
public enum ReleaseFormat: String, Codable, Sendable, Hashable, Equatable {
case cd = "CD"
case cdR = "CD-R"
case enhancedCD = "Enhanced CD"
case vinyl = "Vinyl"
case vinyl12 = "12\" Vinyl"
case vinyl10 = "10\" Vinyl"
case vinyl7 = "7\" Vinyl"
case cassette = "Cassette"
case digitalMedia = "Digital Media"
case dvd = "DVD"
case dvdVideo = "DVD-Video"
case dvdAudio = "DVD-Audio"
case bluRay = "Blu-ray"
case miniDisc = "MiniDisc"
case sacd = "SACD"
case ld = "LD"
case vhs = "VHS"
case other = "Other"
// Fallback decoding for unknown formats
public init(from decoder: Decoder) throws {
let container = try decoder.singleValueContainer()
let rawValue = try container.decode(String.self)
self = ReleaseFormat(rawValue: rawValue) ?? .other
}
}