fix scheduled list reschedule removes item entirely

pull/1323/head
deniscerri 4 weeks ago
parent ef44936ece
commit a5e2ab4154
No known key found for this signature in database
GPG Key ID: 95C43D517D830350

@ -187,10 +187,9 @@ class ScheduledDownloadsFragment : Fragment(), ScheduledDownloadAdapter.OnItemCl
removeItem(it, sheet) removeItem(it, sheet)
}, },
downloadItem = { downloadItem = {
downloadViewModel.deleteDownload(it.id)
it.downloadStartTime = 0 it.downloadStartTime = 0
runBlocking { runBlocking {
downloadViewModel.queueDownloads(listOf(it)) downloadViewModel.queueDownloads(listOf(it), ignoreDuplicates = true)
} }
}, },
longClickDownloadButton = { longClickDownloadButton = {
@ -204,11 +203,9 @@ class ScheduledDownloadsFragment : Fragment(), ScheduledDownloadAdapter.OnItemCl
scheduleButtonClick = {downloadItem -> scheduleButtonClick = {downloadItem ->
UiUtil.showDatePicker(parentFragmentManager, preferences) { UiUtil.showDatePicker(parentFragmentManager, preferences) {
Toast.makeText(context, getString(R.string.download_rescheduled_to) + " " + it.time, Toast.LENGTH_LONG).show() Toast.makeText(context, getString(R.string.download_rescheduled_to) + " " + it.time, Toast.LENGTH_LONG).show()
downloadViewModel.deleteDownload(downloadItem.id)
downloadItem.downloadStartTime = it.timeInMillis downloadItem.downloadStartTime = it.timeInMillis
runBlocking { runBlocking {
downloadViewModel.queueDownloads(listOf(downloadItem)) downloadViewModel.queueDownloads(listOf(downloadItem), ignoreDuplicates = true)
adapter.notifyItemChanged(position)
} }
} }
} }

Loading…
Cancel
Save