//
//  LiveInfo+Extension.swift
//  Gami
//
//  Created by OneeChan on 2026/3/26.
//

import Foundation
import AtomicXCore


private let seatApplyCountKey = "mic_apply_num"
private let state_mic_mute = "state_mic_mute"

extension LiveInfo {
    var roomType: LNRoomType {
        guard let value = categoryList.first?.intValue else {
            return .unknown
        }
        return LNRoomType(rawValue: value)
    }
    
    var applySeatCount: Int {
        guard let value = metaData[seatApplyCountKey],
              let count = Int(value) else {
            return 0
        }
        return count
    }
    
    var forbidAudio: Bool {
        metaData[state_mic_mute] == "1"
    }
}
