summaryrefslogtreecommitdiff
path: root/Sora/Data/Booru/BooruRating.swift
blob: f4814e803c386fc58341659b3a4d1b7faddee3b3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
enum BooruRating: String, CaseIterable, Decodable, Encodable {
  case explicit = "Explicit"
  case questionable = "Questionable"
  case safe = "Safe"

  init(_ string: String) {
    switch string {
    case "e":
      self = .explicit

    case "s":
      self = .safe

    default:
      self = .questionable
    }
  }
}