Newer
Older
bremer / src / main / kotlin / model / api / Audio.kt
yhornisse on 22 Jul 2023 631 bytes add alias_name
/*
 * Copyright (c) 2023. yo-saito. All Rights Reserved.
 */

package net.piedpiper.bremer.model.api

import net.piedpiper.bremer.entity.AudioEntity

data class AudioListResponse(
    private val entities: List<AudioEntity>
) {
    val audio: List<Audio> =
        entities.map { Audio(it) }

    data class Audio(
        private val entity: AudioEntity
    ) {
        val name: String = entity.name
        val slug: String = entity.slug
        val artist: String? = entity?.album?.artist?.name
        val album: String? = entity?.album?.name
        var aliasNames: List<String>? = entity?.aliasNames?.map { it.name }
    }
}