no found media error message

This commit is contained in:
rebelonion 2024-01-16 14:59:38 -06:00
parent 68ccff2259
commit 0cfcfcb9ac

View file

@ -211,6 +211,9 @@ class OfflineAnimeFragment : Fragment(), OfflineAnimeSearchListener {
downloadManager.removeMedia(item.title, type) downloadManager.removeMedia(item.title, type)
val mediaIds = requireContext().getSharedPreferences(getString(R.string.anime_downloads), Context.MODE_PRIVATE) val mediaIds = requireContext().getSharedPreferences(getString(R.string.anime_downloads), Context.MODE_PRIVATE)
?.all?.filter { it.key.contains(item.title) }?.values ?: emptySet() ?.all?.filter { it.key.contains(item.title) }?.values ?: emptySet()
if (mediaIds.isEmpty()) {
snackString("No media found") // if this happens, terrible things have happened
}
for (mediaId in mediaIds) { for (mediaId in mediaIds) {
ani.dantotsu.download.video.Helper.downloadManager(requireContext()) ani.dantotsu.download.video.Helper.downloadManager(requireContext())
.removeDownload(mediaId.toString()) .removeDownload(mediaId.toString())