toJSON method
Implementation
Map<String, dynamic> toJSON()=>{
'id': id,
'name': name,
'description': description,
'imgUrl': imgUrl,
'ownerId': ownerId,
'ownerName': ownerName,
'ownerImgUrl': ownerImgUrl,
'duration': duration,
'previewUrl': previewUrl,
'size': size.name,
'type': type.name,
'genres': genres.map((genre) => genre.toJSON()).toList(),
'publisher': publisher,
'publishedDate': publishedDate
};