//
//  PlaybackTrackingRepository.swift
//  SodaLive
//
//  Created by klaus on 2023/08/11.
//

import Foundation
import ObjectBox

final class PlaybackTrackingRepository {
    private let objectBoxService = ObjectBoxService()
    
    func savePlaybackTracking(data: PlaybackTracking) -> Id {
        return try! objectBoxService.playbackTrackingBox.put(data)
    }
    
    func getPlaybackTracking(id: Id) -> PlaybackTracking? {
        return try! objectBoxService.playbackTrackingBox.get(id)
    }
    
    func getAllPlaybackTracking() -> [PlaybackTracking] {
        return try! objectBoxService.playbackTrackingBox.all()
    }
    
    func removeAllPlaybackTracking() {
        try! objectBoxService.playbackTrackingBox.removeAll()
    }
}
