Skip to content

Commit

Permalink
Remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
stoyicker committed Aug 5, 2024
1 parent 7331d67 commit af24fca
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import java.util.UUID

internal sealed class StreamingSession private constructor(
val id: UUID,
val versionedCdmCalculator: VersionedCdm.Calculator,
val configuration: Configuration,
) {

Expand Down Expand Up @@ -86,19 +85,11 @@ internal sealed class StreamingSession private constructor(
)
}

class Explicit(
id: UUID,
versionedCdmCalculator: VersionedCdm.Calculator,
configuration: Configuration,
) :
StreamingSession(id, versionedCdmCalculator, configuration)
class Explicit(id: UUID, configuration: Configuration) :
StreamingSession(id, configuration)

class Implicit(
id: UUID,
versionedCdmCalculator: VersionedCdm.Calculator,
configuration: Configuration,
) :
StreamingSession(id, versionedCdmCalculator, configuration)
class Implicit(id: UUID, configuration: Configuration) :
StreamingSession(id, configuration)

sealed class Creator<T : Factory> private constructor(
private val factory: T,
Expand Down Expand Up @@ -145,36 +136,25 @@ internal sealed class StreamingSession private constructor(

sealed class Factory private constructor(
protected val uuidWrapper: UUIDWrapper,
protected val versionedCdmCalculator: VersionedCdm.Calculator,
protected val configuration: Configuration,
) {

abstract fun create(): StreamingSession

class Explicit(
uuidWrapper: UUIDWrapper,
versionedCdmCalculator: VersionedCdm.Calculator,
configuration: Configuration,
) :
Factory(uuidWrapper, versionedCdmCalculator, configuration) {
class Explicit(uuidWrapper: UUIDWrapper, configuration: Configuration) :
Factory(uuidWrapper, configuration) {

override fun create(): StreamingSession = Explicit(
uuidWrapper.randomUUID,
versionedCdmCalculator,
configuration,
)
}

class Implicit(
uuidWrapper: UUIDWrapper,
versionedCdmCalculator: VersionedCdm.Calculator,
configuration: Configuration,
) :
Factory(uuidWrapper, versionedCdmCalculator, configuration) {
class Implicit(uuidWrapper: UUIDWrapper, configuration: Configuration) :
Factory(uuidWrapper, configuration) {

override fun create(): StreamingSession = Implicit(
uuidWrapper.randomUUID,
versionedCdmCalculator,
configuration,
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ import com.tidal.sdk.player.playbackengine.mediasource.TidalMediaSourceCreator
import com.tidal.sdk.player.playbackengine.mediasource.loadable.PlaybackInfoLoadableFactory
import com.tidal.sdk.player.playbackengine.mediasource.loadable.PlaybackInfoLoadableLoaderCallbackFactory
import com.tidal.sdk.player.playbackengine.mediasource.streamingsession.StreamingSession
import com.tidal.sdk.player.playbackengine.mediasource.streamingsession.VersionedCdm
import com.tidal.sdk.player.playbackengine.model.AssetTimeoutConfig
import com.tidal.sdk.player.playbackengine.offline.OfflineDrmHelper
import com.tidal.sdk.player.playbackengine.offline.OfflinePlayDataSourceFactoryHelper
Expand Down Expand Up @@ -491,11 +490,8 @@ internal object MediaSourcererModule {

@Provides
@Reusable
fun explicitStreamingSessionFactory(
uuidWrapper: UUIDWrapper,
versionedCdmCalculator: VersionedCdm.Calculator,
configuration: Configuration,
) = StreamingSession.Factory.Explicit(uuidWrapper, versionedCdmCalculator, configuration)
fun explicitStreamingSessionFactory(uuidWrapper: UUIDWrapper, configuration: Configuration) =
StreamingSession.Factory.Explicit(uuidWrapper, configuration)

@Provides
@Reusable
Expand All @@ -511,11 +507,8 @@ internal object MediaSourcererModule {

@Provides
@Reusable
fun implicitStreamingSessionFactory(
uuidWrapper: UUIDWrapper,
versionedCdmCalculator: VersionedCdm.Calculator,
configuration: Configuration,
) = StreamingSession.Factory.Implicit(uuidWrapper, versionedCdmCalculator, configuration)
fun implicitStreamingSessionFactory(uuidWrapper: UUIDWrapper, configuration: Configuration) =
StreamingSession.Factory.Implicit(uuidWrapper, configuration)

@Provides
@Reusable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ import com.tidal.sdk.player.common.UUIDWrapper
internal class ExplicitStreamingSessionFactoryTest : StreamingSessionFactoryTest() {

override val streamingSessionFactoryF =
{
uuidWrapper: UUIDWrapper,
versionedCdmCalculator: VersionedCdm.Calculator,
configuration: Configuration,
->
StreamingSession.Factory.Explicit(uuidWrapper, versionedCdmCalculator, configuration)
{ uuidWrapper: UUIDWrapper, configuration: Configuration ->
StreamingSession.Factory.Explicit(uuidWrapper, configuration)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ import com.tidal.sdk.player.common.UUIDWrapper
internal class ImplicitStreamingSessionFactoryTest : StreamingSessionFactoryTest() {

override val streamingSessionFactoryF =
{
uuidWrapper: UUIDWrapper,
versionedCdmCalculator: VersionedCdm.Calculator,
configuration: Configuration,
->
StreamingSession.Factory.Implicit(uuidWrapper, versionedCdmCalculator, configuration)
{ uuidWrapper: UUIDWrapper, configuration: Configuration ->
StreamingSession.Factory.Implicit(uuidWrapper, configuration)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,15 @@ import org.mockito.kotlin.whenever
internal abstract class StreamingSessionFactoryTest {

private val uuidWrapper = mock<UUIDWrapper>()
private val versionedCdmCalculator = mock<VersionedCdm.Calculator>()
private val configuration = mock<Configuration>()
protected abstract val streamingSessionFactoryF:
(UUIDWrapper, VersionedCdm.Calculator, Configuration) -> StreamingSession.Factory
(UUIDWrapper, Configuration) -> StreamingSession.Factory
private val streamingSessionFactory by lazy {
streamingSessionFactoryF(uuidWrapper, versionedCdmCalculator, configuration)
streamingSessionFactoryF(uuidWrapper, configuration)
}

@AfterEach
fun tearDown() = verifyNoMoreInteractions(uuidWrapper, versionedCdmCalculator, configuration)
fun tearDown() = verifyNoMoreInteractions(uuidWrapper, configuration)

@Test
fun createCreatesInstanceWithProvidedData() {
Expand Down

0 comments on commit af24fca

Please sign in to comment.