This commit is contained in:
deniscerri 2025-08-03 15:07:40 +02:00
parent 073a427ab7
commit aff25b31e2
No known key found for this signature in database
GPG key ID: 95C43D517D830350
2 changed files with 5 additions and 1 deletions

View file

@ -364,12 +364,16 @@ interface DownloadDao {
items.forEachIndexed { idx, it ->
updateDownloadID(-(it.id), newIDs[idx])
updateDownloadRowNumber(newIDs[idx], items.size - idx)
}
}
@Query("Update downloads set id=:newId where id=:id")
suspend fun updateDownloadID(id: Long, newId: Long)
@Query("Update downloads set rowNumber=:newNr where id=:id")
suspend fun updateDownloadRowNumber(id: Long, newNr: Int)
@Query("SELECT id from downloads WHERE id > :item1 AND id < :item2 AND status in (:statuses) ORDER BY id DESC")
fun getIDsBetweenTwoItems(item1: Long, item2: Long, statuses: List<String>) : List<Long>

View file

@ -281,7 +281,7 @@ class ConfigureMultipleDownloadsAdapter(onItemClickListener: OnItemClickListener
companion object {
private val DIFF_CALLBACK: DiffUtil.ItemCallback<DownloadItemConfigureMultiple> = object : DiffUtil.ItemCallback<DownloadItemConfigureMultiple>() {
override fun areItemsTheSame(oldItem: DownloadItemConfigureMultiple, newItem: DownloadItemConfigureMultiple): Boolean {
return oldItem.url == newItem.url
return oldItem.id == newItem.id
}
override fun areContentsTheSame(oldItem: DownloadItemConfigureMultiple, newItem: DownloadItemConfigureMultiple): Boolean {