#include "file_types.hpp"

bool isVideoFile(std::string filename, fileType &type) {
    size_t dotPos = filename.find_last_of('.');
    if (dotPos == std::string::npos) {
        type = unknown;
        return false;
    }

    std::string ext = filename.substr(dotPos + 1);
    if (ext == "mp4") {
        type = mp4;
    } else if (ext == "avi") {
        type = avi;
    } else if (ext == "mkv") {
        type = mkv;
    } else if (ext == "mov") {
        type = mov;
    } else if (ext == "flv") {
        type = flv;
    } else if (ext == "webm") {
        type = webm;
    } else {
        type = unknown;
        return false;
    }
    return true;
}
