switch base directory to media directory

This commit is contained in:
qimiko committed 2024-01-15 22:27:46 -07:00
1 parent e7ebea1ea6
commit 6168fa46c9
1 file changed
+11 -1
@@ -76,7 +76,17 @@ object LaunchUtils {
* Returns the directory that Geode/the game should base itself off of.
*/
fun getBaseDirectory(context: Context): File {
return context.getExternalFilesDir("")!!
// deprecated, but seems to be the best choice of directory (i forced mat to test it)
// also, is getting the first item the correct choice here?? what do they mean
@Suppress("DEPRECATION")
val dir = context.externalMediaDirs.first()
// prevent having resources added to system gallery
// accessing this file every time the directory is read may be a little wasteful...
val noMediaPath = File(dir, ".nomedia")
noMediaPath.createNewFile()
return dir
}
fun getSaveDirectory(context: Context): File {