package tooic.fatalityic.corroborateic.poisedic.drowningic.rainic

import warpic.Seventeenthic.isDoc
import warpic.Seventeenthic.isDocx
import warpic.Seventeenthic.isFlac
import warpic.Seventeenthic.isMp3
import warpic.Seventeenthic.isPPT
import warpic.Seventeenthic.isPPTX
import warpic.Seventeenthic.isPdf
import warpic.Seventeenthic.isWav
import warpic.Seventeenthic.isXls
import warpic.Seventeenthic.isXlsx
import java.io.File

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

    companion object {
        fun Irritantic.setDocumentType() {
            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 Irritantic.setAudioType() {
            val file = File(path)
            if (isMp3(file)) {
                type = "MP3"
            }
            if (isWav(file)) {
                type = "WAV"
            }
            if (isFlac(file)) {
                type = "FLAC"
            }
        }

    }
}