package com.ux.video.file.filerecovery.utils

enum class ScanType(val value: Int) {

    ALL_PHOTO(0),
    DELETED_PHOTO(1),

    ALL_VIDEO(2),
    DELETED_VIDEO(3),

    ALL_AUDIO(4),
    DELETED_AUDIO(5),

    ALL_DOCUMENT(6),
    DELETED_DOCUMENT(7);


    val mediaType: FileType
        get() = when (this) {
            ALL_PHOTO, DELETED_PHOTO -> FileType.PHOTO
            ALL_VIDEO, DELETED_VIDEO -> FileType.VIDEO
            ALL_AUDIO, DELETED_AUDIO -> FileType.AUDIO
            ALL_DOCUMENT, DELETED_DOCUMENT -> FileType.DOCUMENT
        }

    val isDeletedScan: Boolean
        get() = when (this) {
            DELETED_PHOTO,
            DELETED_VIDEO,
            DELETED_AUDIO,
            DELETED_DOCUMENT -> true
            else -> false
        }
    companion object {
        fun from(value: Int): ScanType? =
            ScanType.entries.find { it.value == value }
    }
}
