Skip to content

Commit a63ab4d

Browse files
committed
Fix
Fix
1 parent 208e838 commit a63ab4d

File tree

5 files changed

+5
-119
lines changed

5 files changed

+5
-119
lines changed

IMPLEMENTATION_SUMMARY.md

Lines changed: 0 additions & 109 deletions
This file was deleted.

app/src/main/java/com/nasahacker/convertit/service/ConvertItService.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,9 @@ class ConvertItService : Service() {
6060
super.onDestroy()
6161
Log.i(TAG, "Service destroyed")
6262

63-
// Cancel ongoing conversion job
6463
conversionJob?.cancel()
6564
conversionJob = null
6665

67-
// Cancel all FFmpeg sessions
6866
FFmpegKit.cancel()
6967
Log.i(TAG, "Cancelled all FFmpeg sessions in onDestroy")
7068
}
@@ -87,11 +85,9 @@ class ConvertItService : Service() {
8785
if (intent?.action == ACTION_STOP_SERVICE) {
8886
Log.i(TAG, "Stopping service as per user request. startId: $startId")
8987

90-
// Cancel ongoing conversion job
9188
conversionJob?.cancel()
9289
conversionJob = null
9390

94-
// Cancel all FFmpeg sessions
9591
FFmpegKit.cancel()
9692
Log.i(TAG, "Cancelled all FFmpeg sessions")
9793

app/src/main/java/com/nasahacker/convertit/ui/screen/HomeScreen.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,9 @@ fun HomeScreen(
187187
audioUri = metadataUri,
188188
onDismissRequest = {
189189
showMetadataDialog = false
190-
viewModel.setMetadataUri(null) // Clear the URI
190+
viewModel.setMetadataUri(null)
191191
},
192192
onMetadataSaved = {
193-
// Optionally refresh or update UI after metadata is saved
194193
}
195194
)
196195
}

app/src/main/java/com/nasahacker/convertit/ui/viewmodel/AppViewModel.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ class AppViewModel : ViewModel() {
4545
val isSuccess = intent?.getBooleanExtra(IS_SUCCESS, false) == true
4646
viewModelScope.launch {
4747
_conversionStatus.value = isSuccess
48-
// Clear URI list regardless of success or failure
4948
clearUriList()
5049
}
5150
}

app/src/main/java/com/nasahacker/convertit/util/AppUtil.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import com.nasahacker.convertit.dto.Metadata
4747
import kotlinx.coroutines.Dispatchers
4848
import kotlinx.coroutines.withContext
4949
import java.io.ByteArrayOutputStream
50+
import androidx.core.content.edit
5051

5152
/**
5253
* @author Tamim Hossain
@@ -325,18 +326,18 @@ object AppUtil {
325326

326327
fun saveCustomSaveLocation(context: Context, uri: Uri) {
327328
val sharedPrefs = context.getSharedPreferences(APP_PREF, Context.MODE_PRIVATE)
328-
sharedPrefs.edit().putString(PREF_CUSTOM_SAVE_LOCATION, uri.toString()).apply()
329+
sharedPrefs.edit { putString(PREF_CUSTOM_SAVE_LOCATION, uri.toString()) }
329330
}
330331

331332
fun getCustomSaveLocation(context: Context): Uri? {
332333
val sharedPrefs = context.getSharedPreferences(APP_PREF, Context.MODE_PRIVATE)
333334
val uriString = sharedPrefs.getString(PREF_CUSTOM_SAVE_LOCATION, null)
334-
return uriString?.let { Uri.parse(it) }
335+
return uriString?.toUri()
335336
}
336337

337338
fun clearCustomSaveLocation(context: Context) {
338339
val sharedPrefs = context.getSharedPreferences(APP_PREF, Context.MODE_PRIVATE)
339-
sharedPrefs.edit().remove(PREF_CUSTOM_SAVE_LOCATION).apply()
340+
sharedPrefs.edit { remove(PREF_CUSTOM_SAVE_LOCATION) }
340341
}
341342

342343
fun getCurrentSaveLocationPath(context: Context): String {

0 commit comments

Comments
 (0)