package importantedto.concreteedto.cameedto

import importantedto.gallonedto.Buttocksedto.isDoc
import importantedto.gallonedto.Buttocksedto.isDocx
import importantedto.gallonedto.Buttocksedto.isFlac
import importantedto.gallonedto.Buttocksedto.isMp3
import importantedto.gallonedto.Buttocksedto.isPPT
import importantedto.gallonedto.Buttocksedto.isPPTX
import importantedto.gallonedto.Buttocksedto.isPdf
import importantedto.gallonedto.Buttocksedto.isWav
import importantedto.gallonedto.Buttocksedto.isXls
import importantedto.gallonedto.Buttocksedto.isXlsx
import java.io.File

data class Absenceedto(
    val path: String = "",
) {
    var isSelect: Boolean = false
    var isThumbnails: Boolean = false
    var type: String = ""

    companion object {
        fun Absenceedto.setType() {
            val file = File(path)
            if (isPdf(file)) {
                type = "PDF"
            }
            if (isDocx(file) || isDoc(file)) {
                type = "DOC"
            }
            if (isXlsx(file) || isXls(file)) {
                type = "XLS"
            }
            if (isPPTX(file) || isPPT(file)) {
                type = "PPT"
            }
        }

        fun Absenceedto.setAudioType() {
            val file = File(path)
            if (isMp3(file)) {
                type = "MP3"
            }
            if (isWav(file)) {
                type = "WAV"
            }
            if (isFlac(file)) {
                type = "FLAC"
            }
        }
    }
}