Skip to content

Commit cbe3c19

Browse files
Fixed detekt
Signed-off-by: daniele-verducci <daniele.verducci@nextcloud.com>
1 parent aea7023 commit cbe3c19

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

app/src/main/java/com/nextcloud/utils/extensions/FileExtensions.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import java.nio.file.Path
2323
import java.nio.file.attribute.BasicFileAttributes
2424

2525
private const val TAG = "FileExtensions"
26+
private const val MS_IN_SECOND = 1000
2627

2728
fun OCFile?.logFileSize(tag: String) {
2829
val size = DisplayUtils.bytesToHumanReadable(this?.fileLength ?: -1)
@@ -126,10 +127,10 @@ fun OCFile?.isTheSameAs(localFile: File?): Boolean = try {
126127
val remoteName = this.fileName
127128
val localSize = localFile.length()
128129
val remoteSize = this.fileLength
129-
val localCreated = attr.creationTime().toMillis() / 1000 // Unix time in milliseconds
130-
val localModified = attr.lastModifiedTime().toMillis() / 1000 // Unix time in milliseconds
130+
val localCreated = attr.creationTime().toMillis() / MS_IN_SECOND // Unix time in milliseconds
131+
val localModified = attr.lastModifiedTime().toMillis() / MS_IN_SECOND // Unix time in milliseconds
131132
val remoteCreated = this.creationTimestamp // Unix time in seconds!
132-
val remoteModified = this.modificationTimestamp / 1000 // Unix time in milliseconds
133+
val remoteModified = this.modificationTimestamp / MS_IN_SECOND // Unix time in milliseconds
133134
remoteName == localName &&
134135
remoteSize == localSize &&
135136
remoteCreated == localCreated &&

0 commit comments

Comments
 (0)