Skip to content

Commit

Permalink
Fix methods naming (#12)
Browse files Browse the repository at this point in the history
- Fix search media, json parsing will not throw error.
- Rename endpoint methods `getRadioAlphabeticalRadioShowsByChannelId` to
`getRadioAlphabeticalShowsByChannelId`
  • Loading branch information
StaehliJ authored Jul 3, 2023
1 parent e4ff0ec commit 1327b07
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ object Config {
const val minSdk = 21

const val major = 0
const val minor = 3
const val minor = 4
const val patch = 0
const val versionName = "$major.$minor.$patch"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ch.srg.dataProvider.integrationlayer.data.remote

import java.util.*
import com.squareup.moshi.JsonClass
import java.util.Date

/**
* Copyright (c) SRG SSR. All rights reserved.
Expand All @@ -12,17 +13,34 @@ sealed interface Bucket {
val count: Int
}

@JsonClass(generateAdapter = true)
data class MediaTypeBucket(val mediaType: MediaType, override val count: Int) : Bucket

@JsonClass(generateAdapter = true)
data class SubtitlesAvailableBucket(val subtitlesAvailable: Boolean, override val count: Int) : Bucket

@JsonClass(generateAdapter = true)
data class DownloadAvailableBucket(val downloadAvailable: Boolean, override val count: Int) : Bucket

@JsonClass(generateAdapter = true)
data class PlayableAbroadBucket(val playableAbroad: Boolean, override val count: Int) : Bucket

@JsonClass(generateAdapter = true)
data class QualityBucket(val quality: Quality, override val count: Int) : Bucket

@JsonClass(generateAdapter = true)
data class TopicBucket(val urn: String, val title: String, override val count: Int) : Bucket

@JsonClass(generateAdapter = true)
data class ShowBucket(val urn: String, val title: String, override val count: Int) : Bucket

@JsonClass(generateAdapter = true)
data class DurationInMinutesBucket(val duration: Long, override val count: Int) : Bucket

@JsonClass(generateAdapter = true)
data class DateBucket(val date: Date, override val count: Int) : Bucket

@JsonClass(generateAdapter = true)
data class MediaAggregations(
val mediaTypeList: List<MediaTypeBucket>? = null,
val subtitlesAvailableList: List<SubtitlesAvailableBucket>? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,10 @@ class DataProviderPaging @Inject constructor(
)
}

fun getTvAlphabeticalShows(bu: Bu, radioChannelId: String, pageSize: Int = DefaultPageSize): Flow<PagingData<Show>> {
fun getRadioAlphabeticalShowsByChannelId(bu: Bu, radioChannelId: String, pageSize: Int = DefaultPageSize): Flow<PagingData<Show>> {
return createNextUrlPagingData(
pageSize = pageSize,
initialCall = { ilService.getRadioAlphabeticalRadioShowsByChannelId(bu = bu, channelId = radioChannelId, pageSize = it.toIlPaging()) },
initialCall = { ilService.getRadioAlphabeticalShowsByChannelId(bu = bu, channelId = radioChannelId, pageSize = it.toIlPaging()) },
nextCall = { ilService.getShowListNextUrl(it) }
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ interface IlService {
): SongListResult

@GET("2.0/{bu}/showList/radio/alphabeticalByChannel/{channelId}")
suspend fun getRadioAlphabeticalRadioShowsByChannelId(
suspend fun getRadioAlphabeticalShowsByChannelId(
@Path("bu") bu: Bu,
@Path("channelId") channelId: String,
@Query("pageSize") pageSize: IlPaging?
Expand Down

0 comments on commit 1327b07

Please sign in to comment.