Skip to content

Commit

Permalink
Refactor: Merge MediaSource and MediaSynchronizer (#477)
Browse files Browse the repository at this point in the history
* merge: mediasource and media synchronizer

* add interface for media synchronizer

* refactor: remove extension functions in mediasynchronizer

* lint: run ktlintFormat
  • Loading branch information
anilbeesetti authored Aug 1, 2023
1 parent 4de89e2 commit 8140514
Show file tree
Hide file tree
Showing 9 changed files with 213 additions and 244 deletions.
3 changes: 2 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ dependencies {

implementation(project(":core:common"))
implementation(project(":core:data"))
implementation(project(":core:ui"))
implementation(project(":core:media"))
implementation(project(":core:model"))
implementation(project(":core:ui"))
implementation(project(":feature:videopicker"))
implementation(project(":feature:player"))
implementation(project(":feature:settings"))
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/dev/anilbeesetti/nextplayer/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import com.google.accompanist.permissions.ExperimentalPermissionsApi
import com.google.accompanist.permissions.isGranted
import com.google.accompanist.permissions.rememberPermissionState
import dagger.hilt.android.AndroidEntryPoint
import dev.anilbeesetti.nextplayer.core.data.MediaSynchronizer
import dev.anilbeesetti.nextplayer.core.media.sync.MediaSynchronizer
import dev.anilbeesetti.nextplayer.core.model.ThemeConfig
import dev.anilbeesetti.nextplayer.core.ui.theme.NextPlayerTheme
import dev.anilbeesetti.nextplayer.navigation.settingsNavGraph
Expand Down Expand Up @@ -93,7 +93,7 @@ class MainActivity : ComponentActivity() {

LaunchedEffect(key1 = storagePermissionState.status.isGranted) {
if (storagePermissionState.status.isGranted) {
synchronizer.sync()
synchronizer.startSync()
}
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package dev.anilbeesetti.nextplayer.core.media

import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import dev.anilbeesetti.nextplayer.core.media.sync.LocalMediaSynchronizer
import dev.anilbeesetti.nextplayer.core.media.sync.MediaSynchronizer
import javax.inject.Singleton

@Module
@InstallIn(SingletonComponent::class)
interface MediaModule {

@Binds
@Singleton
fun bindsMediaSynchronizer(
mediaSynchronizer: LocalMediaSynchronizer
): MediaSynchronizer
}

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 8140514

Please sign in to comment.