make sure we call getLatestMediaId from a background thread

This commit is contained in:
tibbi 2017-12-17 20:53:17 +01:00
parent 67be9efbe3
commit 1c433b1ebf
2 changed files with 8 additions and 3 deletions

View File

@ -526,9 +526,11 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
}
private fun gotDirectories(newDirs: ArrayList<Directory>, isFromCache: Boolean) {
val dirs = getSortedDirectories(newDirs)
Thread {
mLatestMediaId = getLatestMediaId()
}.start()
mLatestMediaId = getLatestMediaId()
val dirs = getSortedDirectories(newDirs)
directories_refresh_layout.isRefreshing = false
mIsGettingDirs = false

View File

@ -537,7 +537,10 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
}
private fun gotMedia(media: ArrayList<Medium>, isFromCache: Boolean = false) {
mLatestMediaId = getLatestMediaId()
Thread {
mLatestMediaId = getLatestMediaId()
}.start()
mIsGettingMedia = false
media_refresh_layout.isRefreshing = false