Skip to content
Snippets Groups Projects
Commit 666ca858 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

ModelsHelper: Sanity check

parent 11699fd0
No related branches found
No related tags found
No related merge requests found
Pipeline #5745 passed with stage
in 3 minutes and 52 seconds
......@@ -106,7 +106,7 @@ object ModelsHelper {
return if (item.title.isEmpty() || !Character.isLetter(item.title[0]) || ModelsHelper.isSpecialItem(item)) "#" else item.title.substring(0, 1).toUpperCase()
}
fun getHeader(context: Context, sort: Int, item: MediaLibraryItem, aboveItem: MediaLibraryItem?) = when (sort) {
fun getHeader(context: Context?, sort: Int, item: MediaLibraryItem, aboveItem: MediaLibraryItem?) = if (context !== null) when (sort) {
Medialibrary.SORT_DEFAULT,
Medialibrary.SORT_FILENAME,
Medialibrary.SORT_ALPHA -> {
......@@ -160,7 +160,7 @@ object ModelsHelper {
}
}
else -> null
}
} else null
private fun getTimeCategory(timestamp: Long): Int {
val delta = (System.currentTimeMillis() / 1000L) - timestamp
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment