improve file signature by getting its name too

This commit is contained in:
tibbi 2018-04-12 20:50:02 +02:00
parent ce3ce0bec0
commit 51f0d87638
1 changed files with 4 additions and 1 deletions

View File

@ -3,7 +3,10 @@ package com.simplemobiletools.gallery.extensions
import com.bumptech.glide.signature.ObjectKey
import java.io.File
fun String.getFileSignature() = ObjectKey(File(this).lastModified().toString())
fun String.getFileSignature(): ObjectKey {
val file = File(this)
return ObjectKey("${file.name}${file.lastModified()}")
}
fun String.isThisOrParentIncluded(includedPaths: MutableSet<String>) = includedPaths.any { startsWith(it, true) }