@ -17,42 +17,42 @@ class RadiosCache(data: List<Radio>) : CacheItem<Radio>(data)
@@ -17,42 +17,42 @@ class RadiosCache(data: List<Radio>) : CacheItem<Radio>(data)
class FavoritedCache ( data : List < Int > ) : CacheItem < Int > ( data )
class QueueCache ( data : List < Track > ) : CacheItem < Track > ( data )
abstract class Funkwhale Response< D : Any > {
abstract class Otter Response< D : Any > {
abstract val count : Int
abstract val next : String ?
abstract fun getData ( ) : List < D >
}
data class UserResponse ( override val count : Int , override val next : String ? , val results : List < Artist > ) : Funkwhale Response< Artist > ( ) {
data class UserResponse ( override val count : Int , override val next : String ? , val results : List < Artist > ) : Otter Response< Artist > ( ) {
override fun getData ( ) = results
}
data class ArtistsResponse ( override val count : Int , override val next : String ? , val results : List < Artist > ) : Funkwhale Response< Artist > ( ) {
data class ArtistsResponse ( override val count : Int , override val next : String ? , val results : List < Artist > ) : Otter Response< Artist > ( ) {
override fun getData ( ) = results
}
data class AlbumsResponse ( override val count : Int , override val next : String ? , val results : AlbumList ) : Funkwhale Response< Album > ( ) {
data class AlbumsResponse ( override val count : Int , override val next : String ? , val results : AlbumList ) : Otter Response< Album > ( ) {
override fun getData ( ) = results
}
data class TracksResponse ( override val count : Int , override val next : String ? , val results : List < Track > ) : Funkwhale Response< Track > ( ) {
data class TracksResponse ( override val count : Int , override val next : String ? , val results : List < Track > ) : Otter Response< Track > ( ) {
override fun getData ( ) = results
}
data class FavoritedResponse ( override val count : Int , override val next : String ? , val results : List < Favorited > ) : Funkwhale Response< Int > ( ) {
data class FavoritedResponse ( override val count : Int , override val next : String ? , val results : List < Favorited > ) : Otter Response< Int > ( ) {
override fun getData ( ) = results . map { it . track }
}
data class PlaylistsResponse ( override val count : Int , override val next : String ? , val results : List < Playlist > ) : Funkwhale Response< Playlist > ( ) {
data class PlaylistsResponse ( override val count : Int , override val next : String ? , val results : List < Playlist > ) : Otter Response< Playlist > ( ) {
override fun getData ( ) = results
}
data class PlaylistTracksResponse ( override val count : Int , override val next : String ? , val results : List < PlaylistTrack > ) : Funkwhale Response< PlaylistTrack > ( ) {
data class PlaylistTracksResponse ( override val count : Int , override val next : String ? , val results : List < PlaylistTrack > ) : Otter Response< PlaylistTrack > ( ) {
override fun getData ( ) = results
}
data class RadiosResponse ( override val count : Int , override val next : String ? , val results : List < Radio > ) : Funkwhale Response< Radio > ( ) {
data class RadiosResponse ( override val count : Int , override val next : String ? , val results : List < Radio > ) : Otter Response< Radio > ( ) {
override fun getData ( ) = results
}