fix: Small improvements

This commit is contained in:
Myzel394 2024-01-05 19:56:20 +01:00
parent 298ce13369
commit 3cbf822b88
No known key found for this signature in database
GPG Key ID: 79CC92F37B3E1A2B
6 changed files with 12 additions and 11 deletions

View File

@ -26,7 +26,6 @@
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
<!-- Todo: Check android permissions -->
<!-- Starting with Android 29, apps don't need to request the READ_EXTERNAL_STORAGE permission
for files in their own MediaStore -->
<uses-permission

View File

@ -32,8 +32,7 @@ class AudioBatchesFolder(
override val ffmpegParameters = FFMPEG_PARAMETERS
override val scopedMediaContentUri: Uri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI
override val legacyMediaFolder = File(
// TODO: Add support for `DIRECTORY_RECORDINGS`
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM),
Environment.getExternalStoragePublicDirectory(BASE_LEGACY_STORAGE_FOLDER),
MEDIA_RECORDINGS_SUBFOLDER,
)
@ -73,7 +72,7 @@ class AudioBatchesFolder(
)!!
} else {
val path = arrayOf(
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM),
Environment.getExternalStoragePublicDirectory(BASE_LEGACY_STORAGE_FOLDER),
MEDIA_SUBFOLDER_NAME,
getName(date, extension)
).joinToString("/")
@ -145,6 +144,7 @@ class AudioBatchesFolder(
else -> viaCustomFolder(context, DocumentFile.fromTreeUri(context, Uri.parse(folder))!!)
}
val BASE_LEGACY_STORAGE_FOLDER = Environment.DIRECTORY_PODCASTS
val MEDIA_RECORDINGS_SUBFOLDER = MEDIA_SUBFOLDER_NAME + "/audio_recordings"
val BASE_SCOPED_STORAGE_RELATIVE_PATH =
(if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S)

View File

@ -289,11 +289,14 @@ abstract class BatchesFolder(
extension = extension,
)
// TODO: Smoother transition from start to status
concatenationFunction(
filePaths,
outputFile,
parameter
) { time ->
// The progressbar for the conversion is calculated based on the
// current time of the conversion and the total time of the batches.
if (fullTime != null) {
onProgress(time / fullTime!!)
} else {

View File

@ -32,7 +32,7 @@ class VideoBatchesFolder(
override val ffmpegParameters = FFMPEG_PARAMETERS
override val scopedMediaContentUri: Uri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI
override val legacyMediaFolder = File(
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM),
Environment.getExternalStoragePublicDirectory(BASE_LEGACY_STORAGE_FOLDER),
MEDIA_RECORDINGS_SUBFOLDER,
)
@ -59,7 +59,7 @@ class VideoBatchesFolder(
val mediaUri = getOrCreateMediaFile(
name = getName(date, extension),
mimeType = "video/$extension",
relativePath = Environment.DIRECTORY_DCIM + "/" + MEDIA_SUBFOLDER_NAME,
relativePath = BASE_SCOPED_STORAGE_RELATIVE_PATH + "/" + MEDIA_SUBFOLDER_NAME,
)
return FFmpegKitConfig.getSafParameterForWrite(
@ -68,7 +68,7 @@ class VideoBatchesFolder(
)!!
} else {
val path = arrayOf(
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM),
Environment.getExternalStoragePublicDirectory(BASE_LEGACY_STORAGE_FOLDER),
MEDIA_SUBFOLDER_NAME,
getName(date, extension)
).joinToString("/")
@ -143,9 +143,11 @@ class VideoBatchesFolder(
)
}
val BASE_LEGACY_STORAGE_FOLDER = Environment.DIRECTORY_DCIM
val MEDIA_RECORDINGS_SUBFOLDER = MEDIA_SUBFOLDER_NAME + "/video_recordings"
val BASE_SCOPED_STORAGE_RELATIVE_PATH = Environment.DIRECTORY_DCIM
val SCOPED_STORAGE_RELATIVE_PATH =
Environment.DIRECTORY_DCIM + "/" + MEDIA_RECORDINGS_SUBFOLDER
BASE_SCOPED_STORAGE_RELATIVE_PATH + "/" + MEDIA_RECORDINGS_SUBFOLDER
// Parameters to be passed in descending order
// Those parameters first try to concatenate without re-encoding

View File

@ -17,8 +17,6 @@ val MEDIA_RECORDINGS_PREFIX = "alibi-recording-"
val RECORDER_MEDIA_SELECTED_VALUE = "_'media"
val RECORDER_INTERNAL_SELECTED_VALUE = "_'internal"
// TODO: Check API 24
// You are not allowed to change the constants below.
// If you do so, you will be blocked on GitHub.
const val REPO_URL = "https://github.com/Myzel394/Alibi"

View File

@ -324,7 +324,6 @@ fun RecorderEventsHandler(
progress = processingProgress,
)
// TODO: Add thread for concatenation
if (showRecorderError)
RecorderErrorDialog(
onClose = {