Files
2026-03-21 18:25:21 +01:00

80 lines
2.1 KiB
Swift

import Foundation
public enum Gender: String, Sendable, Hashable, Equatable {
case male, female, other
case notApplicable = "not applicable"
}
public enum ArtistType: String, Sendable, Hashable, Equatable {
case person, group, orchestra, choir, character, other
}
public enum Country: String, Sendable, Hashable, Equatable {
case af = "AF" // Afghanistan
case al = "AL" // Albania
case dz = "DZ" // Algeria
case ad = "AD" // Andorra
case ao = "AO" // Angola
case ar = "AR" // Argentina
case am = "AM" // Armenia
case au = "AU" // Australia
case at = "AT" // Austria
case az = "AZ" // Azerbaijan
case be = "BE" // Belgium
case br = "BR" // Brazil
case ca = "CA" // Canada
case cn = "CN" // China
case dk = "DK" // Denmark
case fi = "FI" // Finland
case fr = "FR" // France
case de = "DE" // Germany
case gr = "GR" // Greece
case `in` = "IN" // India
case id = "ID" // Indonesia
case ie = "IE" // Ireland
case it = "IT" // Italy
case jp = "JP" // Japan
case mx = "MX" // Mexico
case nl = "NL" // Netherlands
case nz = "NZ" // New Zealand
case no = "NO" // Norway
case pl = "PL" // Poland
case pt = "PT" // Portugal
case ru = "RU" // Russia
case kr = "KR" // South Korea
case es = "ES" // Spain
case se = "SE" // Sweden
case ch = "CH" // Switzerland
case tr = "TR" // Turkey
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
}
}