I've got this data class which works for my data, but I wanna change it up some so its easier to work with. I need to make it so a value of
1
represents it being present, and if its null then its not present. That way it can just be a list of the present `Feature`s
@OptIn(ExperimentalSerializationApi::class)
@Serializable
data class SearchFilter(
val sortBy: SortBy? = null,
val filters: List<Filter>
) {
@Serializable
data class Filter(
val uploadDate: UploadDate? = null, // ignore these
val type: Type? = null, // ignore these
val duration: Duration? = null, // ignore these
val hd: Int? = null,
@ProtoNumber(14)
val uhd: Int? = null,
val subtitles: Int? = null,
val creativeCommons: Int? = null,
@ProtoNumber(15)
val spherical: Int? = null,
@ProtoNumber(26)
val vr: Int? = null
)
}
@Serializable
enum class Feature {
LIVE,
UHD,
HD,
SUBTITLES,
CREATIVE_COMMONS,
/** 360° video */
SPHERICAL,
VR
}