Fixed default for cache directory selector

This commit is contained in:
Nite 2021-12-20 19:39:44 +01:00
parent 17e49ff49e
commit 34e232a43a
No known key found for this signature in database
GPG Key ID: 1D1AD59B1C6386C1
2 changed files with 2 additions and 3 deletions

View File

@ -38,7 +38,6 @@ import org.moire.ultrasonic.service.MediaPlayerController
import org.moire.ultrasonic.service.RxBus
import org.moire.ultrasonic.util.Constants
import org.moire.ultrasonic.util.ErrorDialog
import org.moire.ultrasonic.util.FileUtil.defaultMusicDirectory
import org.moire.ultrasonic.util.FileUtil.ultrasonicDirectory
import org.moire.ultrasonic.util.InfoDialog
import org.moire.ultrasonic.util.MediaSessionHandler
@ -287,7 +286,7 @@ class SettingsFragment :
val intent = Intent(Intent.ACTION_OPEN_DOCUMENT_TREE)
if (Settings.cacheLocationUri != "" && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
intent.putExtra(DocumentsContract.EXTRA_INITIAL_URI, defaultMusicDirectory.path)
intent.putExtra(DocumentsContract.EXTRA_INITIAL_URI, Settings.cacheLocationUri)
}
intent.addFlags(RW_FLAG)

View File

@ -44,7 +44,7 @@ class Downloader(
private val jukeboxMediaPlayer: JukeboxMediaPlayer by inject()
// TODO is this cache necessary?
// This cache helps us to avoid creating duplicate DownloadFile instances when showing Entries
private val downloadFileCache = LRUCache<MusicDirectory.Entry, DownloadFile>(100)
private var executorService: ScheduledExecutorService? = null