Skip to content

Commit

Permalink
Apply code review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
abelgardep committed Jul 6, 2021
1 parent 6166408 commit 5bea766
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ buildscript {

// Kotlin
kotlinVersion = "1.5.20"
coroutinesVersion = "1.5.0-native-mt"
coroutinesVersion = "1.5.0"

// Koin
koinVersion = "2.1.5"
Expand Down
4 changes: 2 additions & 2 deletions owncloudApp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dependencies {
implementation 'com.github.chrisbanes:PhotoView:2.3.0'

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion"

implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$archLifecycleVersion"
Expand All @@ -58,7 +58,7 @@ dependencies {
implementation "androidx.fragment:fragment-ktx:$ktxFragmentVersion"

// Preferences
implementation 'androidx.preference:preference:1.1.1'
implementation 'androidx.preference:preference-ktx:1.1.1'

// Tests
testImplementation project(':owncloudTestUtil')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ import org.koin.core.KoinComponent
import org.koin.core.inject
import timber.log.Timber
import java.io.File
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale
import java.util.concurrent.TimeUnit

class CameraUploadsWorker(
Expand Down Expand Up @@ -220,8 +218,6 @@ class CameraUploadsWorker(
sourcePath: String,
lastSyncTimestamp: Long,
): List<DocumentFile> {
val simpleDateFormat = SimpleDateFormat("yyyy/MM/dd HH:mm:ss", Locale.getDefault())

val sourceUri: Uri = sourcePath.toUri()
val documentTree = DocumentFile.fromTreeUri(applicationContext, sourceUri)
val arrayOfLocalFiles = documentTree?.listFiles() ?: arrayOf()
Expand All @@ -231,7 +227,7 @@ class CameraUploadsWorker(
.filter { it.lastModified() > lastSyncTimestamp }
.filter { MimetypeIconUtil.getBestMimeTypeByFilename(it.name).startsWith(syncType.prefixForType) }

Timber.i("Last sync ${syncType.name}: ${simpleDateFormat.format(Date(lastSyncTimestamp))}")
Timber.i("Last sync ${syncType.name}: ${Date(lastSyncTimestamp)}")
Timber.i("${arrayOfLocalFiles.size} files found in folder: ${sourceUri.path}")
Timber.i("${filteredList.size} files are ${syncType.name} and were taken after last sync")

Expand Down
2 changes: 1 addition & 1 deletion owncloudData/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ dependencies {

// Kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion"

implementation "androidx.legacy:legacy-support-v4:$androidX"

Expand Down
2 changes: 1 addition & 1 deletion owncloudDomain/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ dependencies {

// Kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion"

// Dependencies for unit tests
testImplementation project(':owncloudTestUtil')
Expand Down

0 comments on commit 5bea766

Please sign in to comment.