Skip to content

Commit

Permalink
Merge branch '298-integrate-remaining-parts-of-lists' into 298-integr…
Browse files Browse the repository at this point in the history
…ate-remaining-parts-of-lists-1
  • Loading branch information
MGaetan89 committed Nov 16, 2023
2 parents 224b7d9 + e0a36be commit abbd881
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ sealed interface ContentList {
fun parse(backStackEntry: NavBackStackEntry): T
}

data class TvTopics(override val bu: Bu) : ContentListWithBu {
data class TVTopics(override val bu: Bu) : ContentListWithBu {
override fun getDestinationRoute(): String {
return "$RootRoute/$bu/tv/topics"
}

companion object : ContentListFactory<TvTopics> {
companion object : ContentListFactory<TVTopics> {
override val route = "$RootRoute/{bu}/tv/topics"
override val trackerTitle = "tv topics"
override val trackerTitle = "tv-topics"

override fun parse(backStackEntry: NavBackStackEntry): TvTopics {
return TvTopics(backStackEntry.readBu())
override fun parse(backStackEntry: NavBackStackEntry): TVTopics {
return TVTopics(backStackEntry.readBu())
}
}
}
Expand All @@ -71,7 +71,7 @@ sealed interface ContentList {

companion object : ContentListFactory<LatestMediaForTopic> {
override val route = "$RootRoute/latestMediaByTopic/{topicUrn}?topic={topic}"
override val trackerTitle = "Latest media for topic"
override val trackerTitle = "latest-media-for-topic"

override fun parse(backStackEntry: NavBackStackEntry): LatestMediaForTopic {
val arguments = backStackEntry.arguments
Expand All @@ -98,7 +98,7 @@ sealed interface ContentList {

companion object : ContentListFactory<LatestMediaForShow> {
override val route = "$RootRoute/latestMediaByShow/{showUrn}?show={show}"
override val trackerTitle = "Latest media for show"
override val trackerTitle = "latest-media-for-show"

override fun parse(backStackEntry: NavBackStackEntry): LatestMediaForShow {
val arguments = backStackEntry.arguments
Expand All @@ -111,17 +111,17 @@ sealed interface ContentList {
}
}

data class TvShows(override val bu: Bu) : ContentListWithBu {
data class TVShows(override val bu: Bu) : ContentListWithBu {
override fun getDestinationRoute(): String {
return "$RootRoute/$bu/tv/shows"
}

companion object : ContentListFactory<TvShows> {
companion object : ContentListFactory<TVShows> {
override val route = "$RootRoute/{bu}/tv/shows"
override val trackerTitle = "tv shows"
override val trackerTitle = "tv-shows"

override fun parse(backStackEntry: NavBackStackEntry): TvShows {
return TvShows(backStackEntry.readBu())
override fun parse(backStackEntry: NavBackStackEntry): TVShows {
return TVShows(backStackEntry.readBu())
}
}
}
Expand All @@ -133,7 +133,7 @@ sealed interface ContentList {

companion object : ContentListFactory<TVLatestMedias> {
override val route = "$RootRoute/{bu}/tv/latestMedia"
override val trackerTitle = "tv latest medias"
override val trackerTitle = "tv-latest-videos"

override fun parse(backStackEntry: NavBackStackEntry): TVLatestMedias {
return TVLatestMedias(backStackEntry.readBu())
Expand All @@ -148,7 +148,7 @@ sealed interface ContentList {

companion object : ContentListFactory<TVLivestreams> {
override val route = "$RootRoute/{bu}/tv/livestream"
override val trackerTitle = "tv livestreams"
override val trackerTitle = "tv-livestreams"

override fun parse(backStackEntry: NavBackStackEntry): TVLivestreams {
return TVLivestreams(backStackEntry.readBu())
Expand All @@ -163,7 +163,7 @@ sealed interface ContentList {

companion object : ContentListFactory<TVLiveCenter> {
override val route = "$RootRoute/{bu}/tv/livecenter"
override val trackerTitle = "tv live center"
override val trackerTitle = "live-center"

override fun parse(backStackEntry: NavBackStackEntry): TVLiveCenter {
return TVLiveCenter(backStackEntry.readBu())
Expand All @@ -178,7 +178,7 @@ sealed interface ContentList {

companion object : ContentListFactory<TVLiveWeb> {
override val route = "$RootRoute/{bu}/tv/liveweb"
override val trackerTitle = "tv live web"
override val trackerTitle = "live-web"

override fun parse(backStackEntry: NavBackStackEntry): TVLiveWeb {
return TVLiveWeb(backStackEntry.readBu())
Expand All @@ -193,7 +193,7 @@ sealed interface ContentList {

companion object : ContentListFactory<RadioLiveStreams> {
override val route = "$RootRoute/{bu}/radio/livestream"
override val trackerTitle = "Radio livestreams"
override val trackerTitle = "radio-livestreams"

override fun parse(backStackEntry: NavBackStackEntry): RadioLiveStreams {
return RadioLiveStreams(backStackEntry.readBu())
Expand All @@ -208,7 +208,7 @@ sealed interface ContentList {

companion object : ContentListFactory<RadioShows> {
override val route = "$RootRoute/{bu}/radio/shows/{radioChannel}"
override val trackerTitle = "Radio shows"
override val trackerTitle = "shows"

override fun parse(backStackEntry: NavBackStackEntry): RadioShows {
return RadioShows(backStackEntry.readRadioChannel())
Expand All @@ -223,7 +223,7 @@ sealed interface ContentList {

companion object : ContentListFactory<RadioLatestMedias> {
override val route = "$RootRoute/{bu}/radio/latestMedia/{radioChannel}"
override val trackerTitle = "Radio latest medias"
override val trackerTitle = "latest-audios"

override fun parse(backStackEntry: NavBackStackEntry): RadioLatestMedias {
return RadioLatestMedias(backStackEntry.readRadioChannel())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ class ContentListViewModel(
}
}

is ContentList.TvShows -> {
is ContentList.TVShows -> {
ilRepository.getTVShows(contentList.bu).map { pagingData ->
pagingData.map { show -> Content.Show(show) }
}
}

is ContentList.TvTopics -> {
is ContentList.TVTopics -> {
ilRepository.getTvTopics(contentList.bu).map { pagingData ->
pagingData.map { topic -> Content.Topic(topic) }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ private val bus = listOf(Bu.RTS, Bu.SRF, Bu.RSI, Bu.RTR, Bu.SWI)
* All the sections available in the "Lists" tab.
*/
val contentListSections = listOf(
ContentListSection("TV Topics", bus.map { ContentList.TvTopics(it) }),
ContentListSection("TV Shows", bus.map { ContentList.TvShows(it) }),
ContentListSection("TV Latest medias", bus.map { ContentList.TVLatestMedias(it) }),
ContentListSection("TV Topics", bus.map { ContentList.TVTopics(it) }),
ContentListSection("TV Shows", bus.map { ContentList.TVShows(it) }),
ContentListSection("TV Latest Videos", bus.map { ContentList.TVLatestMedias(it) }),
ContentListSection("TV Livestreams", bus.map { ContentList.TVLivestreams(it) }),
ContentListSection("TV Live center", bus.map { ContentList.TVLiveCenter(it) }),
ContentListSection("TV Live web", bus.map { ContentList.TVLiveWeb(it) }),
ContentListSection("Radio livestream", bus.map { ContentList.RadioLiveStreams(it) }),
ContentListSection("Radio Latest medias", RadioChannel.entries.map { ContentList.RadioLatestMedias(it) }),
ContentListSection("TV Live Center", bus.map { ContentList.TVLiveCenter(it) }),
ContentListSection("TV Live Web", bus.map { ContentList.TVLiveWeb(it) }),
ContentListSection("Radio Livestreams", bus.map { ContentList.RadioLiveStreams(it) }),
ContentListSection("Radio Latest Audios", RadioChannel.entries.map { ContentList.RadioLatestMedias(it) }),
ContentListSection("Radio Shows", RadioChannel.entries.map { ContentList.RadioShows(it) }),
)

/**
* All the types of content list in the "Lists" tab.
*/
val contentListFactories = listOf(
ContentList.TvTopics,
ContentList.TvShows,
ContentList.TVTopics,
ContentList.TVShows,
ContentList.TVLatestMedias,
ContentList.TVLivestreams,
ContentList.TVLiveCenter,
Expand Down

0 comments on commit abbd881

Please sign in to comment.