File tree Expand file tree Collapse file tree
app/src/main/java/com/nextcloud/utils/extensions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import java.nio.file.Path
2323import java.nio.file.attribute.BasicFileAttributes
2424
2525private const val TAG = " FileExtensions"
26+ private const val MS_IN_SECOND = 1000
2627
2728fun 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 &&
You can’t perform that action at this time.
0 commit comments