Skip to content

Commit

Permalink
#122 Add TraktCode Repository
Browse files Browse the repository at this point in the history
  • Loading branch information
hadi-norouzi committed Sep 11, 2024
1 parent bbe2f30 commit 4579045
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package io.filmtime.data.trakt.auth

import io.filmtime.data.model.GeneralError
import io.filmtime.data.model.Result
import io.filmtime.data.model.TraktCodeLogin
import io.filmtime.data.model.TraktTokens
import kotlinx.coroutines.flow.Flow

Expand All @@ -14,4 +15,6 @@ interface TraktAuthRepository {
suspend fun refreshTokenByAccessToken(accessToken: String)

suspend fun logout()

suspend fun getLoginCode(): Result<TraktCodeLogin, GeneralError>
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package io.filmtime.data.trakt.auth
import io.filmtime.data.api.trakt.TraktAuthRemoteSource
import io.filmtime.data.model.GeneralError
import io.filmtime.data.model.Result
import io.filmtime.data.model.TraktCodeLogin
import io.filmtime.data.model.TraktTokens
import io.filmtime.data.storage.trakt.TraktAuthLocalSource
import kotlinx.coroutines.flow.Flow
Expand Down Expand Up @@ -33,4 +34,7 @@ class TraktAuthRepositoryImpl @Inject constructor(
override suspend fun logout() {
traktAuthLocalSource.clearAuthTokens()
}

override suspend fun getLoginCode(): Result<TraktCodeLogin, GeneralError> =
traktAuthRemoteSource.getLoginCode()
}

0 comments on commit 4579045

Please sign in to comment.