pull/1226/head
deniscerri 1 month ago
parent 6006bfc1c1
commit 3ec78a0281
No known key found for this signature in database
GPG Key ID: 95C43D517D830350

@ -78,7 +78,7 @@ interface HistoryDao {
fun getAllHistoryList() : List<HistoryItem>
@Query("SELECT * FROM history WHERE id=:id LIMIT 1")
fun getHistoryItem(id: Long) : HistoryItem
fun getHistoryItem(id: Long) : HistoryItem?
@Query("SELECT * FROM history WHERE url=:url")
fun getAllHistoryByURL(url: String) : List<HistoryItem>

@ -20,7 +20,7 @@ class HistoryRepository(private val historyDao: HistoryDao) {
DATE, TITLE, AUTHOR, FILESIZE
}
fun getItem(id: Long) : HistoryItem {
fun getItem(id: Long) : HistoryItem? {
return historyDao.getHistoryItem(id)
}

@ -167,13 +167,16 @@ class DownloadsAlreadyExistDialog : BottomSheetDialogFragment(), AlreadyExistsAd
val historyItem = withContext(Dispatchers.IO){
downloadViewModel.getHistoryItemById(historyItemID)
}
UiUtil.showHistoryItemDetailsCard(historyItem, requireActivity(), isPresent = true, preferences,
removeItem = { item, deleteFile ->
historyViewModel.delete(item, deleteFile)
},
redownloadItem = { },
redownloadShowDownloadCard = {}
)
historyItem?.apply {
UiUtil.showHistoryItemDetailsCard(historyItem, requireActivity(), isPresent = true, preferences,
removeItem = { item, deleteFile ->
historyViewModel.delete(item, deleteFile)
},
redownloadItem = { },
redownloadShowDownloadCard = {}
)
}
}
}
}
Loading…
Cancel
Save