mirror of
https://github.com/Myzel394/Alibi.git
synced 2025-06-19 07:15:25 +02:00
refactor: Use constants instead of hardcoded values
This commit is contained in:
parent
7c6e44dd69
commit
9d4345c2d1
@ -15,6 +15,8 @@ import java.time.LocalDateTime
|
|||||||
import java.time.format.DateTimeFormatter
|
import java.time.format.DateTimeFormatter
|
||||||
import com.arthenica.ffmpegkit.FFmpegKitConfig
|
import com.arthenica.ffmpegkit.FFmpegKitConfig
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
|
import app.myzel394.alibi.ui.RECORDER_INTERNAL_SELECTED_VALUE
|
||||||
|
import app.myzel394.alibi.ui.RECORDER_MEDIA_SELECTED_VALUE
|
||||||
import kotlinx.coroutines.CompletableDeferred
|
import kotlinx.coroutines.CompletableDeferred
|
||||||
import kotlin.reflect.KFunction3
|
import kotlin.reflect.KFunction3
|
||||||
|
|
||||||
@ -236,9 +238,9 @@ abstract class BatchesFolder(
|
|||||||
|
|
||||||
fun exportFolderForSettings(): String {
|
fun exportFolderForSettings(): String {
|
||||||
return when (type) {
|
return when (type) {
|
||||||
BatchType.INTERNAL -> "_'internal"
|
BatchType.INTERNAL -> RECORDER_INTERNAL_SELECTED_VALUE
|
||||||
|
BatchType.MEDIA -> RECORDER_MEDIA_SELECTED_VALUE
|
||||||
BatchType.CUSTOM -> customFolder!!.uri.toString()
|
BatchType.CUSTOM -> customFolder!!.uri.toString()
|
||||||
BatchType.MEDIA -> "_'media"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ import android.os.ParcelFileDescriptor
|
|||||||
import android.provider.MediaStore
|
import android.provider.MediaStore
|
||||||
import androidx.documentfile.provider.DocumentFile
|
import androidx.documentfile.provider.DocumentFile
|
||||||
import app.myzel394.alibi.helpers.MediaConverter.Companion.concatenateVideoFiles
|
import app.myzel394.alibi.helpers.MediaConverter.Companion.concatenateVideoFiles
|
||||||
|
import app.myzel394.alibi.ui.RECORDER_INTERNAL_SELECTED_VALUE
|
||||||
import app.myzel394.alibi.ui.RECORDER_MEDIA_SELECTED_VALUE
|
import app.myzel394.alibi.ui.RECORDER_MEDIA_SELECTED_VALUE
|
||||||
import com.arthenica.ffmpegkit.FFmpegKitConfig
|
import com.arthenica.ffmpegkit.FFmpegKitConfig
|
||||||
import java.time.LocalDateTime
|
import java.time.LocalDateTime
|
||||||
@ -96,7 +97,7 @@ class VideoBatchesFolder(
|
|||||||
fun viaMediaFolder(context: Context) = VideoBatchesFolder(context, BatchType.MEDIA)
|
fun viaMediaFolder(context: Context) = VideoBatchesFolder(context, BatchType.MEDIA)
|
||||||
|
|
||||||
fun importFromFolder(folder: String, context: Context) = when (folder) {
|
fun importFromFolder(folder: String, context: Context) = when (folder) {
|
||||||
"_'internal" -> viaInternalFolder(context)
|
RECORDER_INTERNAL_SELECTED_VALUE -> viaInternalFolder(context)
|
||||||
RECORDER_MEDIA_SELECTED_VALUE -> viaMediaFolder(context)
|
RECORDER_MEDIA_SELECTED_VALUE -> viaMediaFolder(context)
|
||||||
else -> viaCustomFolder(
|
else -> viaCustomFolder(
|
||||||
context,
|
context,
|
||||||
|
@ -11,6 +11,7 @@ val RECORDER_SUBFOLDER_NAME = ".recordings"
|
|||||||
val VIDEO_RECORDER_SUPPORTS_CUSTOM_FOLDER = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
|
val VIDEO_RECORDER_SUPPORTS_CUSTOM_FOLDER = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
|
||||||
val MEDIA_RECORDINGS_PREFIX = "alibi-recording-"
|
val MEDIA_RECORDINGS_PREFIX = "alibi-recording-"
|
||||||
val RECORDER_MEDIA_SELECTED_VALUE = "_'media"
|
val RECORDER_MEDIA_SELECTED_VALUE = "_'media"
|
||||||
|
val RECORDER_INTERNAL_SELECTED_VALUE = "_'internal"
|
||||||
|
|
||||||
// You are not allowed to change the constants below.
|
// You are not allowed to change the constants below.
|
||||||
// If you do so, you will be blocked on GitHub.
|
// If you do so, you will be blocked on GitHub.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user