import Foundation

public extension URL {
    func validateCachedFile() -> Bool {
        guard let attributes = try? FileManager.default.attributesOfItem(atPath: self.path),
              let fileSize = attributes[FileAttributeKey.size] as? UInt,
              fileSize > 0 && self.pathExtension.lowercased() == "mp4"
        else {
            return false
        }
        return true
    }
}
