File tree Expand file tree Collapse file tree 2 files changed +4
-16
lines changed
AnkiDroid/src/main/java/com/ichi2
anki/ui/windows/managespace Expand file tree Collapse file tree 2 files changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,6 @@ import com.ichi2.anki.ui.dialogs.tools.DialogResult
4444import com.ichi2.anki.ui.dialogs.tools.awaitDialog
4545import com.ichi2.anki.utils.getUserFriendlyErrorText
4646import com.ichi2.anki.withProgress
47- import com.ichi2.async.clearMediaAndTrash
4847import com.ichi2.preferences.TextWidgetPreference
4948import kotlinx.coroutines.CoroutineScope
5049import kotlinx.coroutines.Dispatchers
@@ -110,7 +109,10 @@ class ManageSpaceViewModel(
110109
111110 suspend fun deleteMediaFiles (filesNamesToDelete : List <String >) {
112111 try {
113- withCol { clearMediaAndTrash(this @withCol, filesNamesToDelete) }
112+ withCol {
113+ media.trashFiles(filesNamesToDelete)
114+ media.emptyTrash()
115+ }
114116 } finally {
115117 launchCalculationOfSizeOfEverything()
116118 launchCalculationOfCollectionSize()
Original file line number Diff line number Diff line change @@ -22,20 +22,6 @@ import com.ichi2.anki.libanki.Collection
2222import com.ichi2.anki.libanki.NotetypeJson
2323import timber.log.Timber
2424
25- /* *
26- * Trashes the specified media files and immediately empties the trash in the given [Collection].
27- *
28- * @param col The [Collection] from which media files should be removed.
29- * @param unused A list of media file names to be deleted.
30- */
31- fun clearMediaAndTrash (
32- col : Collection ,
33- unused : List <String >,
34- ) {
35- col.media.trashFiles(unused)
36- col.media.emptyTrash()
37- }
38-
3925/* *
4026 * Handles everything for a note type change at once - template add / deletes as well as content updates
4127 */
You can’t perform that action at this time.
0 commit comments