Map<String, dynamic> toMap() { return {"total": total, "files": files.map((p) => p.toMap()).toList()}; }