Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions config/detekt/popcorngp-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
{
"filePattern": "^.*/data/.+\\.kt$",
"forbiddenDependencies": [
"^.*/domain/.+\\.kt$",
"^.*/presentation/.+\\.kt$"
".*\\.presentation\\..+"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

codigo que tem 'data' no path não pode depender de presentation

]
},
{
"filePattern": "^.*/domain/.+\\.kt$",
"forbiddenDependencies": [
"^.*/presentation/.+\\.kt$"
".*\\.presentation\\..+"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

codigo que tem 'domain' no path não pode depender de presentation

]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,14 @@ package com.codandotv.streamplayerapp.feature.detail.data
import com.codandotv.streamplayerapp.core.local.storage.data.dao.FavoriteDao
import com.codandotv.streamplayerapp.core.networking.handleError.toFlow
import com.codandotv.streamplayerapp.feature.detail.domain.DetailStream
import com.codandotv.streamplayerapp.feature.detail.domain.DetailStreamRepository
import com.codandotv.streamplayerapp.feature.detail.domain.VideoStream
import com.codandotv.streamplayerapp.feature.detail.domain.toDetailStream
import com.codandotv.streamplayerapp.feature.detail.domain.toDetailStreamLocal
import com.codandotv.streamplayerapp.feature.detail.domain.toVideoStreams
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map

interface DetailStreamRepository {
suspend fun getMovie(): Flow<DetailStream>
suspend fun deleteFromMyList(movie: String)
suspend fun insertToMyList(movie: DetailStream)
suspend fun isFavorite(movieId: String): Boolean
suspend fun getVideoStreams(): Flow<List<VideoStream>>
}

class DetailStreamRepositoryImpl(
private val movieId: String,
private val service: DetailStreamService,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.codandotv.streamplayerapp.feature.detail.domain

import kotlinx.coroutines.flow.Flow

interface DetailStreamRepository {
suspend fun getMovie(): Flow<DetailStream>
suspend fun deleteFromMyList(movie: String)
suspend fun insertToMyList(movie: DetailStream)
suspend fun isFavorite(movieId: String): Boolean
suspend fun getVideoStreams(): Flow<List<VideoStream>>
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,20 @@ package com.codandotv.streamplayerapp.feature.profile.data

import com.codandotv.streamplayerapp.core.networking.handleError.toFlow
import com.codandotv.streamplayerapp.core.networking.handleError.toResult
import com.codandotv.streamplayerapp.feature.profile.domain.ProfilePickerStreamRepository
import com.codandotv.streamplayerapp.feature.profile.domain.ProfileStream
import com.codandotv.streamplayerapp.feature.profile.domain.toProfiles
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.map
import org.koin.core.annotation.Factory

interface ProfilePickerStreamRepository {
suspend fun getProfiles(): Flow<List<com.codandotv.streamplayerapp.feature.profile.domain.ProfileStream>>
}

@Factory
class ProfilePickerStreamRepositoryImpl(
private val service: ProfilePickerStreamService
) : ProfilePickerStreamRepository {

override suspend fun getProfiles(): Flow<List<com.codandotv.streamplayerapp.feature.profile.domain.ProfileStream>> {
override suspend fun getProfiles(): Flow<List<ProfileStream>> {
with(service.getProfiles()) {
if (this.toResult().isFailure || this.toResult().getOrNull() == null) {
return flowOf(mockProfiles)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.codandotv.streamplayerapp.feature.profile.domain

import kotlinx.coroutines.flow.Flow

interface ProfilePickerStreamRepository {
suspend fun getProfiles(): Flow<List<ProfileStream>>
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.codandotv.streamplayerapp.feature.search.domain.mapper
package com.codandotv.streamplayerapp.feature.search.presentation.mapper

import com.codandotv.streamplayerapp.core.shared.Url
import com.codandotv.streamplayerapp.feature.search.data.model.ListSearchStreamResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.navigation.NavController
import com.codandotv.streamplayerapp.core.navigation.extensions.goBack
import com.codandotv.streamplayerapp.feature.search.domain.mapper.toSearchStreamCardModel
import com.codandotv.streamplayerapp.feature.search.presentation.mapper.toSearchStreamCardModel
import com.codandotv.streamplayerapp.feature.search.presentation.widgets.SearchStreamCard
import com.codandotv.streamplayerapp.feature.search.presentation.widgets.SearchableTopBar
import com.codandotv.streamplayerapp.feature.search.presentation.widgets.StreamsEmpty
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ cameraCore = "1.4.2"
moko-permissions = "0.19.1"

#Test
popcornguineapigDetektRule = "1.0.0"
popcornguineapigDetektRule = "1.0.1"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bump lib

test_junit = "4.13.2"
androidx_core_testing = "2.2.0"
mockk = "1.13.7"
Expand Down
Loading